diff --git a/src/common.js b/src/common.js
index f4270725bb..2850c1031f 100644
--- a/src/common.js
+++ b/src/common.js
@@ -715,21 +715,22 @@
this.el = jQuery('', {
'class': 'btn btn-default',
'type': 'button'
- }).text(attributes.string || '')
- .append(jQuery('', {
- 'class': 'glyphicon',
+ });
+ this.icon = jQuery('
', {
+ 'class': 'icon',
'aria-hidden': true
- }));
+ }).appendTo(this.el);
+ this.el.append(attributes.string || '');
this.set_icon(attributes.icon);
},
set_icon: function(icon_name) {
if (!icon_name) {
+ this.icon.attr('src', '');
return;
}
var prm = Sao.common.ICONFACTORY.register_icon(icon_name);
prm.done(function(url) {
- this.el.children('.glyphicon').css(
- 'background-image', 'url("' + url + '")');
+ this.icon.attr('src', url);
}.bind(this));
},
set_state: function(record) {
diff --git a/src/sao.less b/src/sao.less
index 6305199537..bcaf321b68 100644
--- a/src/sao.less
+++ b/src/sao.less
@@ -29,6 +29,12 @@ input[type='color'] {
}
}
+button {
+ & img.icon {
+ height: unit(@line-height-base, em);
+ }
+}
+
.treeview {
& > table.tree {
width: 100%;