on 2014 Jun 06 8:07 AM
Hi,
Is it possible to change the image of the sap.ui.ux3.Feeder control (the button)?
I want to make the button inside the feeder dynamic, it would be nice if I could change the image and/or add text inside the button.
I've already tried to change the image with jQuery, but I'm not sure if I am doing it right:
$("#Feeder-send-image").attr("src","img/servicedesk.png");
Thanks,
RW
Looks like you can configure the image URLs in the library-parameters.json file, alternatively I guess you could override the initSendButton method.
"sap.ui.ux3.Feed:sapUiFeedToolsIconUrl": "/img/feed/Action_Menu_regular.png",
"sap.ui.ux3.Feed:sapUiFeedToolsIconHoverUrl": "/img/feed/Action_Menu_hover.png",
"sap.ui.ux3.Feeder:sapUiFeederArrowLargeUrl": "/img/feed/Feeder_arrow_large.png",
"sap.ui.ux3.Feeder:sapUiFeederArrowMediumUrl": "/img/feed/Feeder_arrow_medium.png",
"sap.ui.ux3.Feeder:sapUiFeederArrowSmallUrl": "/img/feed/Feeder_arrow_small.png"
Regards,
Jason
sap.ui.ux3.Feeder.prototype.initSendButton = function(){
if (this.getText() == "") {
// no re-rendering as button is not rendered now.
this.oSendButton.setProperty('enabled', false, true);
}
var sArrow = "";
switch (this.getType()){
case( sap.ui.ux3.FeederType.Medium):
sArrow = sap.ui.core.theming.Parameters.get('sap.ui.ux3.Feeder:sapUiFeederArrowMediumUrl');
break;
case( sap.ui.ux3.FeederType.Comment):
sArrow = sap.ui.core.theming.Parameters.get('sap.ui.ux3.Feeder:sapUiFeederArrowSmallUrl');
break;
default: // large feeder is default
sArrow = sap.ui.core.theming.Parameters.get('sap.ui.ux3.Feeder:sapUiFeederArrowLargeUrl');
break;
}
if (!sArrow || sArrow == "") {
// no arrow image
// no re-rendering as button is not rendered now.
this.oSendButton.setProperty('text', '-->', true);
} else {
// no re-rendering as button is not rendered now.
if (sap.ui.getCore().getConfiguration().getRTL()) {
sArrow = sArrow.replace(/\/img\//, "/img-RTL/");
}
this.oSendButton.setProperty('icon', jQuery.sap.getModulePath("sap.ui.ux3", '/') + "themes/" + sap.ui.getCore().getConfiguration().getTheme() + sArrow, true);
}
};
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
11 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.