diff options
Diffstat (limited to 'addons/web/static/src')
9 files changed, 22 insertions, 31 deletions
diff --git a/addons/web/static/src/js/chrome/menu.js b/addons/web/static/src/js/chrome/menu.js index 1e253ba54f7..8613e90afa8 100644 --- a/addons/web/static/src/js/chrome/menu.js +++ b/addons/web/static/src/js/chrome/menu.js @@ -143,7 +143,7 @@ var Menu = Widget.extend({ } // add a tooltip to cropped menu items this.$secondary_menus.find('.oe_secondary_submenu li a span').each(function() { - $(this).tooltip(this.scrollWidth > this.clientWidth ? {title: $(this).text().trim(), placement: 'right'} :'destroy'); + $(this).tooltip(this.scrollWidth > this.clientWidth ? {title: $(this).text().trim(), placement: 'right'} : 'dispose'); }); }, /** diff --git a/addons/web/static/src/js/libs/bootstrap.js b/addons/web/static/src/js/libs/bootstrap.js index 04ca2381d7d..135a6b65df6 100644 --- a/addons/web/static/src/js/libs/bootstrap.js +++ b/addons/web/static/src/js/libs/bootstrap.js @@ -7,23 +7,19 @@ odoo.define('web.bootstrap.extensions', function () { */ /* Bootstrap defaults overwrite */ -$.fn.tooltip.Constructor.DEFAULTS.placement = 'auto top'; -$.fn.tooltip.Constructor.DEFAULTS.html = true; -$.fn.tooltip.Constructor.DEFAULTS.trigger = 'hover focus click'; -$.fn.tooltip.Constructor.DEFAULTS.container = 'body'; -$.fn.tooltip.Constructor.DEFAULTS.delay = { show: 1000, hide: 0 }; -//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.Default.placement = 'top'; +$.fn.tooltip.Constructor.Default.fallbackPlacement = ['bottom', 'right', 'left', 'top']; +$.fn.tooltip.Constructor.Default.html = true; +$.fn.tooltip.Constructor.Default.trigger = 'hover focus click'; +$.fn.tooltip.Constructor.Default.container = 'body'; +$.fn.tooltip.Constructor.Default.delay = { show: 1000, hide: 0 }; + +var bootstrapShowFunction = $.fn.tooltip.Constructor.prototype.show; $.fn.tooltip.Constructor.prototype.show = function () { + // Overwrite bootstrap tooltip method to prevent showing 2 tooltip at the + // same time $('.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); + + return bootstrapShowFunction.call(this); }; }); diff --git a/addons/web/static/src/js/services/crash_manager.js b/addons/web/static/src/js/services/crash_manager.js index a5b8cb32c13..b105913464e 100644 --- a/addons/web/static/src/js/services/crash_manager.js +++ b/addons/web/static/src/js/services/crash_manager.js @@ -142,7 +142,7 @@ var CrashManager = core.Class.extend({ }); }); dialog.on("closed", this, function () { - $clipboardBtn.tooltip("destroy"); + $clipboardBtn.tooltip('dispose'); clipboard.destroy(); }); diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 13a00dda046..197892f3361 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -152,7 +152,6 @@ var BasicRenderer = AbstractRenderer.extend({ // widget's $el $node = $node.length ? $node : widget.$el; $node.tooltip({ - delay: { show: 1000, hide: 0 }, title: function () { return qweb.render('WidgetLabel.tooltip', { debug: config.debug, diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js index 646dfdd8c40..1422392db41 100644 --- a/addons/web/static/src/js/views/form/form_renderer.js +++ b/addons/web/static/src/js/views/form/form_renderer.js @@ -265,7 +265,6 @@ var FormRenderer = BasicRenderer.extend({ _addButtonTooltip: function (node, $button) { var self = this; $button.tooltip({ - delay: { show: 1000, hide: 0 }, title: function () { return qweb.render('WidgetButton.tooltip', { debug: config.debug, diff --git a/addons/web/static/src/js/views/graph/graph_controller.js b/addons/web/static/src/js/views/graph/graph_controller.js index e7f25c23fdd..36a05af7653 100644 --- a/addons/web/static/src/js/views/graph/graph_controller.js +++ b/addons/web/static/src/js/views/graph/graph_controller.js @@ -45,7 +45,7 @@ var GraphController = AbstractController.extend(GroupByMenuInterfaceMixin,{ destroy: function () { if (this.$buttons) { // remove jquery's tooltip() handlers - this.$buttons.find('button').off().tooltip('destroy'); + this.$buttons.find('button').off().tooltip('dispose'); } this._super.apply(this, arguments); }, diff --git a/addons/web/static/src/js/views/kanban/kanban_column.js b/addons/web/static/src/js/views/kanban/kanban_column.js index 95e3f1e85b1..a1c7e415470 100644 --- a/addons/web/static/src/js/views/kanban/kanban_column.js +++ b/addons/web/static/src/js/views/kanban/kanban_column.js @@ -153,7 +153,7 @@ var KanbanColumn = Widget.extend({ this.$el.toggleClass('o_column_folded', this.folded && !config.device.isMobile); var tooltip = this.data.count + _t(' records'); tooltip = '<p>' + tooltip + '</p>' + this.tooltipInfo; - this.$header.find('.o_kanban_header_title').tooltip({html: true}).attr('data-original-title', tooltip); + this.$header.find('.o_kanban_header_title').tooltip({}).attr('data-original-title', tooltip); if (!this.remaining) { this.$('.o_kanban_load_more').remove(); } else { diff --git a/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js b/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js index 7af6b677dcf..0bfe5027876 100644 --- a/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js +++ b/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js @@ -133,9 +133,8 @@ var KanbanColumnProgressBar = Widget.extend({ }); if (this.progressBarHelp && _.every(this.subgroupCounts, function (val) { return val === 0; })) { this.$el.tooltip({ - delay: '0', - trigger:'hover', - placement: 'top', + delay: 0, + trigger: 'hover', title: this.progressBarHelp, }); } @@ -152,9 +151,8 @@ var KanbanColumnProgressBar = Widget.extend({ // Adapt tooltip $bar.attr('data-original-title', count + ' ' + key); $bar.tooltip({ - delay: '0', - trigger:'hover', - placement: 'top' + delay: 0, + trigger: 'hover', }); // Adapt active state diff --git a/addons/web/static/src/js/views/kanban/kanban_record.js b/addons/web/static/src/js/views/kanban/kanban_record.js index 247f8eca90f..09fb956e52c 100644 --- a/addons/web/static/src/js/views/kanban/kanban_record.js +++ b/addons/web/static/src/js/views/kanban/kanban_record.js @@ -99,8 +99,7 @@ var KanbanRecord = Widget.extend({ var tooltip = $el.attr('tooltip'); if (tooltip) { $el.tooltip({ - 'html': true, - 'title': self.qweb.render(tooltip, self.qweb_context) + title: self.qweb.render(tooltip, self.qweb_context) }); } }); @@ -490,7 +489,7 @@ var KanbanRecord = Widget.extend({ if (elem === event.currentTarget) { ischild = false; } - var test_event = events && events.click && (events.click.length > 1 || events.click[0].namespace !== "tooltip"); + var test_event = events && events.click && (events.click.length > 1 || events.click[0].namespace !== 'bs.tooltip'); if (ischild) { children.push(elem); if (test_event) { |
