Fix served Many2One icon padding
This commit is contained in:
@@ -17567,6 +17567,65 @@ function eval_pyson(value){
|
||||
button.attr('aria-label', tooltip);
|
||||
button.attr('title', tooltip);
|
||||
});
|
||||
this._sync_icon_padding();
|
||||
if (window.console) {
|
||||
Sao._many2one_icon_debug_count =
|
||||
Sao._many2one_icon_debug_count || 0;
|
||||
if (Sao._many2one_icon_debug_count < 20) {
|
||||
Sao._many2one_icon_debug_count += 1;
|
||||
window.setTimeout(function() {
|
||||
var rect = function(node) {
|
||||
if (!node) {
|
||||
return null;
|
||||
}
|
||||
var box = node.getBoundingClientRect();
|
||||
return {
|
||||
left: box.left,
|
||||
top: box.top,
|
||||
width: box.width,
|
||||
height: box.height,
|
||||
};
|
||||
};
|
||||
var input = this.entry && this.entry[0];
|
||||
var group = input && input.parentElement;
|
||||
var primary_node = this.but_primary &&
|
||||
this.but_primary.parent()[0];
|
||||
var secondary_node = this.but_secondary &&
|
||||
this.but_secondary.parent()[0];
|
||||
var input_style = input ?
|
||||
window.getComputedStyle(input) : null;
|
||||
console.log('[M2O_ICON_LAYOUT]', {
|
||||
field: this.field_name,
|
||||
groupClass: group ? group.className : null,
|
||||
inputClass: input ? input.className : null,
|
||||
inputPaddingLeft: input_style ?
|
||||
input_style.paddingLeft : null,
|
||||
inputPaddingRight: input_style ?
|
||||
input_style.paddingRight : null,
|
||||
inputRect: rect(input),
|
||||
primaryVisible: primary_node ?
|
||||
primary_node.style.display !== 'none' : null,
|
||||
primaryRect: rect(primary_node),
|
||||
secondaryVisible: secondary_node ?
|
||||
secondary_node.style.display !== 'none' : null,
|
||||
secondaryRect: rect(secondary_node),
|
||||
});
|
||||
}.bind(this), 0);
|
||||
}
|
||||
}
|
||||
},
|
||||
_sync_icon_padding: function() {
|
||||
var rtl = jQuery('html').attr('dir') == 'rtl';
|
||||
var primary_visible = this.but_primary.parent().css('display') !=
|
||||
'none';
|
||||
var secondary_visible = this.but_secondary.parent().css('display') !=
|
||||
'none';
|
||||
var start_padding = primary_visible ? '33px' : '12px';
|
||||
var end_padding = secondary_visible ? '33px' : '12px';
|
||||
this.entry.css({
|
||||
'padding-left': rtl ? end_padding : start_padding,
|
||||
'padding-right': rtl ? start_padding : end_padding,
|
||||
});
|
||||
},
|
||||
focus: function() {
|
||||
this.entry.focus();
|
||||
|
||||
Reference in New Issue
Block a user