diff options
| author | Antony Lesuisse <al@openerp.com> | 2014-06-30 01:54:49 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2014-06-30 01:54:49 +0200 |
| commit | 810a2e6357b7fd2e62bc9b564d7be9c960cb1c4a (patch) | |
| tree | e5ffafd2acbb7f5e9639f17290579e668f9f1335 /addons/web/static/src | |
| parent | 2ae0e6b7c342b8097cdb9045fda83cd8955cc95b (diff) | |
| parent | 5209fbc7ed9fcad966ab064654a8a8697142be42 (diff) | |
Merge branch 'master' into master-autocompletion-ged
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 1 | ||||
| -rw-r--r-- | addons/web/static/src/css/base.sass | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/core.js | 19 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 17 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 1 |
7 files changed, 16 insertions, 25 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index f6a507d7a87..a52cfb22c78 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3377,6 +3377,7 @@ body.oe_single_form .oe_single_form_container { background: white; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); background-color: transparent; + z-index: 1800; } .tooltip .tooltip-inner { text-align: left !important; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f2dda44b72f..76e56b249cf 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2744,6 +2744,7 @@ body.oe_single_form background: white text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) background-color: transparent + z-index: 1800 .tooltip-inner text-align: left !important max-width: 350px diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f21cfbc1f84..9fcbdff1f89 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -183,6 +183,7 @@ instance.web.Dialog = instance.web.Widget.extend({ */ close: function(reason) { if (this.dialog_inited && !this.__tmp_dialog_hiding) { + $('.tooltip').remove(); //remove open tooltip if any to prevent them staying when modal has disappeared this.trigger("closing", reason); if (this.$el.is(":data(bs.modal)")) { // may have been destroyed by closing signal this.__tmp_dialog_hiding = true; diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 29f6c3e4d9e..23645e22bf1 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -773,15 +773,18 @@ instance.web.unblockUI = function() { $.fn.tooltip.Constructor.DEFAULTS.placement = 'auto top'; $.fn.tooltip.Constructor.DEFAULTS.html = true; $.fn.tooltip.Constructor.DEFAULTS.container = 'body'; -//overwrite bootstrap tooltip method to fix bug when using placement -//auto and the parent element does not exist anymore resulting in -//an error. This should be remove once bootstrap fix the bug +//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 (e) { - if (this.$element.parent().length === 0){ - return; - } - return bootstrap_show_function.call(this, e); +$.fn.tooltip.Constructor.prototype.show = function () { + $('.tooltip').remove(); + //the following fix the bug when using placement + //auto and the parent element does not exist anymore resulting in + //an error. This should be remove once we updade bootstrap to a version that fix the bug + //edit: bug has been fixed here : https://github.com/twbs/bootstrap/pull/13752 + var e = $.Event('show.bs.' + this.type); + var inDom = $.contains(document.documentElement, this.$element[0]); + if (e.isDefaultPrevented() || !inDom) return; + return bootstrap_show_function.call(this); }; /** diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 956ec494573..7372e8a3783 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1869,25 +1869,9 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi do_attach_tooltip: function(widget, trigger, options) { widget = widget || this; trigger = trigger || this.$el; - var container = 'body'; - /*TODO: need to be refactor - in the case we can find the view form in the parent, - attach the element to it (to prevent tooltip to keep showing - when switching view) or if we have a modal currently showing, - attach tooltip to the modal to prevent the tooltip to show in the body in the - case we close the modal too fast*/ - if ($(trigger).parents('.oe_view_manager_view_form').length > 0){ - container = $(trigger).parents('.oe_view_manager_view_form'); - } - else { - if (window.$('.modal.in').length>0){ - container = window.$('.modal.in:last()'); - } - } options = _.extend({ delay: { show: 500, hide: 0 }, trigger: 'hover', - container: container, title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { @@ -2399,6 +2383,7 @@ instance.web.form.KanbanSelection = instance.web.form.FieldChar.extend({ if (li.length) { var value = {}; value[self.name] = String(li.data('value')); + self.record_id = self.view.datarecord.id; if (self.record_id) { return self.view.dataset._model.call('write', [[self.record_id], value, self.view.dataset.get_context()]).done(self.reload_record.bind(self)); } else { diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index b4b42b122af..9a192e4db90 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1611,6 +1611,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we .filter(function (column) { return column.tag === 'field';}) .pluck('name').value(), function (groups) { + self.view.$pager.hide(); $el[0].appendChild( self.render_groups(groups)); if (post_render) { post_render(); } diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index a9a444d0004..7b7da1dd744 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -617,7 +617,6 @@ instance.web.ViewManager = instance.web.Widget.extend({ var view_promise; var form = this.views['form']; if (!view || (form && form.controller && !form.controller.can_be_discarded())) { - self.trigger('switch_mode', view_type, no_store, view_options); return $.Deferred().reject(); } if (!no_store) { |
