diff options
| author | Olivier Dony <odo@openerp.com> | 2014-08-01 14:24:07 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2014-08-01 14:24:07 +0200 |
| commit | 494ecc620fd700f62fa3fc451126d26b616859e3 (patch) | |
| tree | 0eaa7807746969e701ca26f631963cfc8f3ff30a /addons/web/static/src | |
| parent | e8eabf770805f99d6e8dbffd6365b157dc7ee714 (diff) | |
| parent | ee4df1e397a7f1ada09f53c3b72d9dddfa9b3e22 (diff) | |
[MERGE] Foward-port saas-5 up to ee4df1e
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/core.js | 14 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
4 files changed, 16 insertions, 4 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index b0e22f918c8..c2b0af4737a 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -115,6 +115,7 @@ instance.web.Dialog = instance.web.Widget.extend({ this.init_dialog(); } this.$buttons.insertAfter(this.$dialog_box.find(".modal-body")); + $('.tooltip').remove(); //remove open tooltip if any to prevent them staying when modal is opened //add to list of currently opened modal opened_modal.push(this.$dialog_box); return this; @@ -1156,7 +1157,7 @@ instance.web.Client = instance.web.Widget.extend({ }, 0); }); instance.web.bus.on('click', this, function(ev) { - $.fn.tooltip('destroy'); + $('.tooltip').remove(); if (!$(ev.target).is('input[type=file]')) { self.$el.find('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened'); } diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 23645e22bf1..47e2a30a3d5 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -772,7 +772,7 @@ instance.web.unblockUI = function() { /* Bootstrap defaults overwrite */ $.fn.tooltip.Constructor.DEFAULTS.placement = 'auto top'; $.fn.tooltip.Constructor.DEFAULTS.html = true; -$.fn.tooltip.Constructor.DEFAULTS.container = 'body'; +$.fn.tooltip.Constructor.DEFAULTS.trigger = 'hover focus click'; //overwrite bootstrap tooltip method to prevent showing 2 tooltip at the same time var bootstrap_show_function = $.fn.tooltip.Constructor.prototype.show; $.fn.tooltip.Constructor.prototype.show = function () { @@ -786,6 +786,18 @@ $.fn.tooltip.Constructor.prototype.show = function () { if (e.isDefaultPrevented() || !inDom) return; return bootstrap_show_function.call(this); }; +//overwrite bootstrap tooltip init method in order to check if tooltip is in a modal or not and +//if so it needs to have a container body in order to be visible +var bootstrap_init_tooltip_fnct = $.fn.tooltip.Constructor.prototype.init; +$.fn.tooltip.Constructor.prototype.init = function (type, element, options) { + options = options || {} + if ($('.modal[aria-hidden="false"]').length !== 0){ + if (options && !options.container){ + options = _.extend({container: 'body'},options); + } + } + return bootstrap_init_tooltip_fnct.call(this, type, element, options); +} /** * Registry for all the client actions key: tag value: widget diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 5767ffe5489..66e500507d9 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1835,7 +1835,6 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi trigger = trigger || this.$el; options = _.extend({ delay: { show: 500, hide: 0 }, - trigger: 'hover', title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index d77b8d3df46..2aeed9e6017 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -40,7 +40,7 @@ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 class="modal-title"><t t-raw="title"/></h3> </div> - <div class="modal-body" style="overflow-y: auto;"> + <div class="modal-body"> </div> </div> </div> |
