[IMP]Improve code for bounce on boolean field
bzr revid: vja@tinyerp.com-20130228134740-jqv0zqletq6v1792
This commit is contained in:
parent
dff2dd0196
commit
4d7cfc9ab3
|
@ -3145,6 +3145,16 @@ div.ui-widget-overlay {
|
|||
.openerp_ie .oe_form_field_boolean input {
|
||||
background: white;
|
||||
}
|
||||
.openerp .oe_form_field_boolean .boolean{
|
||||
position: relative;
|
||||
top: -14px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
z-index:10000;
|
||||
// IE needs a color in order for the layer to respond to mouse events
|
||||
backgroundColor: "#fff";
|
||||
opacity: 0;
|
||||
}
|
||||
.openerp_ie .db_option_table .oe_form_field_selection {
|
||||
width: auto;
|
||||
}
|
||||
|
|
|
@ -2659,6 +2659,7 @@ instance.web.form.FieldBoolean = instance.web.form.AbstractField.extend({
|
|||
}, this));
|
||||
var check_readonly = function() {
|
||||
self.$checkbox.prop('disabled', self.get("effective_readonly"));
|
||||
self.click_disabled_boolean();
|
||||
};
|
||||
this.on("change:effective_readonly", this, check_readonly);
|
||||
check_readonly.call(this);
|
||||
|
@ -2669,7 +2670,19 @@ instance.web.form.FieldBoolean = instance.web.form.AbstractField.extend({
|
|||
},
|
||||
focus: function() {
|
||||
this.$checkbox[0].focus();
|
||||
},
|
||||
click_disabled_boolean: function(){
|
||||
var $disabled = $(document).find('input[type=checkbox]:disabled');
|
||||
$disabled.each(function (){
|
||||
var $parent = $(this).closest("span");
|
||||
if($(this).next('div')){
|
||||
$(this).next('div').remove();
|
||||
}
|
||||
var $overlay = $("<div class=boolean />");
|
||||
$parent.append($overlay);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue