Use jQuery UI primary icons in Button

This commit is contained in:
Cédric Krier committed 2013-10-07 12:38:35 +02:00
1 parent 0a792903dc
commit a4389f26bb
2 files changed
+12 -4

No files matched your search

+4 -4
View File
@@ -343,10 +343,9 @@
this.attributes = attributes;
this.el = jQuery('<button/>').button({
text: true,
label: attributes.string || ''
label: attributes.string || '',
icons: {primary: 'ui-icon-custom', secondary: null}
});
this.img = jQuery('<img/>');
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) {
+8
View File
@@ -74,3 +74,11 @@ body {
width: 100%;
}
}
.form {
& button {
& .ui-icon-custom {
background-size: 16px 16px;
}
}
}