diff --git a/src/common.js b/src/common.js
index 56acb54a7e..b0af48f51c 100644
--- a/src/common.js
+++ b/src/common.js
@@ -343,10 +343,9 @@
this.attributes = attributes;
this.el = jQuery('').button({
text: true,
- label: attributes.string || ''
+ label: attributes.string || '',
+ icons: {primary: 'ui-icon-custom', secondary: null}
});
- this.img = jQuery('
');
- this.el.append(this.img);
this.set_icon(attributes.icon);
},
set_icon: function(icon_name) {
@@ -355,7 +354,8 @@
}
var prm = Sao.common.ICONFACTORY.register_icon(icon_name);
prm.done(function(url) {
- this.img.attr('src', url);
+ this.el.children('.ui-button-icon-primary').css(
+ 'background-image', 'url("' + url + '")');
}.bind(this));
},
set_state: function(record) {
diff --git a/src/sao.less b/src/sao.less
index 137c963a07..911bc82f1f 100644
--- a/src/sao.less
+++ b/src/sao.less
@@ -74,3 +74,11 @@ body {
width: 100%;
}
}
+
+.form {
+ & button {
+ & .ui-icon-custom {
+ background-size: 16px 16px;
+ }
+ }
+}