diff options
| author | bth-openerp <bth@tinyerp.com> | 2013-12-03 15:43:17 +0530 |
|---|---|---|
| committer | bth-openerp <bth@tinyerp.com> | 2013-12-03 15:43:17 +0530 |
| commit | 062e96cc07a1e1ebe76e3bc3de0f788c448bae09 (patch) | |
| tree | 37352e1c603dd033e48c519a7cdc35d060f1f365 /addons/web/static/src | |
| parent | ef08d834f639e4d8b9d1053df833067322d5ce14 (diff) | |
[IMP]Add bootstrap tooltip.
bzr revid: bth@tinyerp.com-20131203101317-bznca04cdosg0x3z
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 18 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 4 |
3 files changed, 16 insertions, 13 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index abbd4767361..c58089f4b5c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1261,8 +1261,8 @@ instance.web.Client = instance.web.Widget.extend({ }, bind_events: function() { var self = this; - this.$el.on('mouseenter', '.oe_systray > div:not([data-tipsy=true])', function() { - $(this).attr('data-tipsy', 'true').tipsy().trigger('mouseenter'); + this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() { + $(this).attr('data-toggle', 'tooltip').tooltip().trigger('mouseenter'); }); this.$el.on('click', '.oe_dropdown_toggle', function(ev) { ev.preventDefault(); @@ -1286,7 +1286,8 @@ instance.web.Client = instance.web.Widget.extend({ }, 0); }); instance.web.bus.on('click', this, function(ev) { - $.fn.tipsy.clear(); + $.fn.tooltip('destroy'); + this.$el.find('.oe_systray').find('div') 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/view_form.js b/addons/web/static/src/js/view_form.js index 683cdebbbf4..748f9bde4f8 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1819,7 +1819,7 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi this.$el.addClass(this.node.attrs["class"] || ""); }, destroy: function() { - $.fn.tipsy.clear(); + $.fn.tooltip('destroy'); this._super.apply(this, arguments); }, /** @@ -1851,9 +1851,9 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi widget = widget || this; trigger = trigger || this.$el; options = _.extend({ - delayIn: 500, - delayOut: 0, - fade: true, + //delayIn: 500, + //delayOut: 0, + //fade: true, title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { @@ -1864,12 +1864,14 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi widget: widget }); }, - gravity: $.fn.tipsy.autoBounds(50, 'nw'), + //gravity: $.fn.tooltip.autoBounds(50, 'nw'), + placement: 'right', html: true, - opacity: 0.85, - trigger: 'hover' + //opacity: 0.85, + //trigger: 'hover' }, options || {}); - $(trigger).tipsy(options); + $(trigger).attr('data-toggle', 'tooltip'); + $(trigger).tooltip(options); }, /** * Builds a new context usable for operations related to fields by merging diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 37369377bf1..80e72a5d813 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -585,7 +585,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ var self = this; this.$el.find('.oe_view_manager_switch a').click(function() { self.switch_mode($(this).data('view-type')); - }).tipsy(); + }).tooltip(); var views_ids = {}; _.each(this.views_src, function(view) { self.views[view.view_type] = $.extend({}, view, { @@ -1152,7 +1152,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ $(this).toggle(!!$(this).find('li').length); }); - self.$("[title]").tipsy({ + self.$("[title]").tooltip({ 'html': true, 'delayIn': 500, }); |
