[FIX] web: remove enforceFocus method from bootstrap modal since it is conflicting...
authorCedric Snauwaert <csn@openerp.com>
Thu, 23 Oct 2014 09:49:07 +0000 (11:49 +0200)
committerCedric Snauwaert <csn@openerp.com>
Thu, 23 Oct 2014 13:04:59 +0000 (15:04 +0200)
This method trigger the focus event when clicking inside the modal, causing a blur event on other widgets resulting in unwanted problem. Typical case is for the jquery datetimepicker where we try to open a select element which will close right after.

addons/web/static/src/js/core.js

index 6e9aafa..31a9475 100644 (file)
@@ -776,6 +776,7 @@ $.fn.tooltip.Constructor.DEFAULTS.trigger = 'hover focus click';
 $.fn.tooltip.Constructor.DEFAULTS.container = 'body';
 //overwrite bootstrap tooltip method to prevent showing 2 tooltip at the same time
 var bootstrap_show_function = $.fn.tooltip.Constructor.prototype.show;
+$.fn.modal.Constructor.prototype.enforceFocus = function () { };
 $.fn.tooltip.Constructor.prototype.show = function () {
     $('.tooltip').remove();
     //the following fix the bug when using placement