updates to input_binding_actionbutton.js and got rid of isIcon function (substituted by simple check instead)

This commit is contained in:
Barbara Borges Ribeiro
2016-03-17 14:47:48 +00:00
parent 3ab5d7f861
commit e1fc74bdc1
7 changed files with 21 additions and 30 deletions

View File

@@ -25,11 +25,13 @@ $.extend(actionButtonInputBinding, {
return { value: this.getValue(el) };
},
receiveMessage: function(el, data) {
var $el = $(el);
// retrieve current label and icon
var label = $(el).text();
var label = $el.text();
var icon = '';
if ($(el).children().length===1) {
var icon_html = $(el).children()[0];
if ($el.find('i.fa, i.glyphicon').length > 0) {
var icon_html = $el.find('i.fa, i.glyphicon')[0];
icon = $(icon_html).prop('outerHTML');
}
@@ -42,8 +44,7 @@ $.extend(actionButtonInputBinding, {
}
// produce new html
$(el).html(icon + ' ' + label);
$(el).trigger('change');
$el.html(icon + ' ' + label);
},
unsubscribe: function(el) {
$(el).off(".actionButtonInputBinding");