Fix icon in button

Use img with the same height as the button line-height

review21441003
This commit is contained in:
Cédric Krier committed 2015-10-04 19:41:59 +02:00
1 parent 22ba269923
commit bf0170cec5
2 files changed
+13 -6

No files matched your search

+7 -6
View File
@@ -715,21 +715,22 @@
this.el = jQuery('<button/>', {
'class': 'btn btn-default',
'type': 'button'
}).text(attributes.string || '')
.append(jQuery('<span/>', {
'class': 'glyphicon',
});
this.icon = jQuery('<img/>', {
'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) {
+6
View File
@@ -29,6 +29,12 @@ input[type='color'] {
}
}
button {
& img.icon {
height: unit(@line-height-base, em);
}
}
.treeview {
& > table.tree {
width: 100%;