[IMP] Disable right click on m2o button

bzr revid: fme@openerp.com-20120111140222-cirxtmubrma6qj9b
This commit is contained in:
Fabien Meghazi
2012-01-11 15:02:22 +01:00
parent 6d64acd8b6
commit 5f3e6fdd9e
2 changed files with 6 additions and 5 deletions
@@ -65,8 +65,10 @@
display(index,this,e,options);
return false;
};
$(this).bind('contextmenu', callback);
if(options.leftClickToo) {
if (!options.noRightClick) {
$(this).bind('contextmenu', callback);
}
if (options.leftClickToo || options.noRightClick) {
$(this).click(callback);
}
return this
@@ -123,4 +125,4 @@
})(jQuery);
$( function() {
$('div.contextMenu').hide()
});
});
+1 -2
View File
@@ -1762,7 +1762,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
self.open_related(self.related_entries[i]);
};
});
var cmenu = self.$menu_btn.contextMenu(self.cm_id, {'leftClickToo': true,
var cmenu = self.$menu_btn.contextMenu(self.cm_id, {'noRightClick': true,
bindings: bindings, itemStyle: {"color": ""},
onContextMenu: function() {
if(self.value) {
@@ -1782,7 +1782,6 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
});
});
var ctx_callback = function(e) {init_context_menu_def.resolve(e); e.preventDefault()};
this.$menu_btn.bind('contextmenu', ctx_callback);
this.$menu_btn.click(ctx_callback);
// some behavior for input