From 062e96cc07a1e1ebe76e3bc3de0f788c448bae09 Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Tue, 3 Dec 2013 15:43:17 +0530 Subject: [IMP]Add bootstrap tooltip. bzr revid: bth@tinyerp.com-20131203101317-bznca04cdosg0x3z --- addons/web/static/src/js/chrome.js | 7 ++++--- addons/web/static/src/js/view_form.js | 18 ++++++++++-------- addons/web/static/src/js/views.js | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'addons/web/static/src') 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, }); -- cgit v1.2.3 From 165d289384a40e08a475385a4d0ea0edbf1bca23 Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Tue, 3 Dec 2013 18:21:13 +0530 Subject: [IMP]Removed tipsy library and add placement in tooltip. bzr revid: bth@tinyerp.com-20131203125113-fuapp6wpvmcif1c5 --- addons/web/static/src/js/views.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 80e72a5d813..01b469d39d1 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -583,9 +583,10 @@ instance.web.ViewManager = instance.web.Widget.extend({ start: function() { this._super(); var self = this; + this.$el.find('.oe_view_manager_switch a').attr('data-toggle', 'tooltip'); this.$el.find('.oe_view_manager_switch a').click(function() { self.switch_mode($(this).data('view-type')); - }).tooltip(); + }).tooltip({'placement': 'bottom'}); var views_ids = {}; _.each(this.views_src, function(view) { self.views[view.view_type] = $.extend({}, view, { -- cgit v1.2.3 From 5d874a4acb1e2e60069d879bef4d49226492b4cd Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Wed, 4 Dec 2013 17:28:24 +0530 Subject: [IMP]Improved css and offset for tooltip. bzr revid: bth@tinyerp.com-20131204115824-tbq4nys4c0d2c327 --- addons/web/static/src/css/base.css | 7 +++++++ addons/web/static/src/js/view_form.js | 10 +++------- addons/web/static/src/js/views.js | 6 +++++- 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 010585ee4a0..96fbcf9f805 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -601,6 +601,7 @@ } .openerp.oe_tooltip { font-size: 12px; + background-color: transparent; } .openerp.oe_tooltip .oe_tooltip_string { color: #ffdd55; @@ -633,6 +634,12 @@ .openerp.oe_tooltip .oe_tooltip_message { max-width: 310px; } +.tooltip-inner { + text-align: left !important; +} +.tooltip.bottom .tooltip-arrow { + left: 12% !important; +} .openerp .oe_notebook { margin: 8px 0; padding: 0 16px; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 748f9bde4f8..ed6d66e5c68 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1851,9 +1851,6 @@ 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, title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { @@ -1864,11 +1861,10 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi widget: widget }); }, - //gravity: $.fn.tooltip.autoBounds(50, 'nw'), - placement: 'right', + container: 'body', + placement: 'bottom', html: true, - //opacity: 0.85, - //trigger: 'hover' + opacity: 0.85, }, options || {}); $(trigger).attr('data-toggle', 'tooltip'); $(trigger).tooltip(options); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 01b469d39d1..f9e8018b183 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -586,7 +586,11 @@ instance.web.ViewManager = instance.web.Widget.extend({ this.$el.find('.oe_view_manager_switch a').attr('data-toggle', 'tooltip'); this.$el.find('.oe_view_manager_switch a').click(function() { self.switch_mode($(this).data('view-type')); - }).tooltip({'placement': 'bottom'}); + }).tooltip({ + container: 'body', + html: true, + opacity: 0.85 + }); var views_ids = {}; _.each(this.views_src, function(view) { self.views[view.view_type] = $.extend({}, view, { -- cgit v1.2.3 From f33076bcd8aba7a513636d45314c0ece3ff5614f Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Wed, 4 Dec 2013 17:52:37 +0530 Subject: [IMP]Set margin-top. bzr revid: bth@tinyerp.com-20131204122237-lsymfmuoiyg5z371 --- addons/web/static/src/css/base.css | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 96fbcf9f805..b4e6d4a24b2 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -639,6 +639,7 @@ } .tooltip.bottom .tooltip-arrow { left: 12% !important; + margin-top: 0.5px; } .openerp .oe_notebook { margin: 8px 0; -- cgit v1.2.3 From 3fd24e1cb5f67fa3c42476b9a6e6e5589ca21e3b Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Thu, 5 Dec 2013 11:50:07 +0530 Subject: [IMP]Add tooltip options and add for search view drawer. bzr revid: bth@tinyerp.com-20131205062007-cbo6wuuyg1buy0we --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/search.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b4e6d4a24b2..6188b3fc26e 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -641,6 +641,9 @@ left: 12% !important; margin-top: 0.5px; } +.tooltip.bottom { + padding: 5px 0 !important; +} .openerp .oe_notebook { margin: 8px 0; padding: 0 16px; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index c58089f4b5c..848f9e1ec3c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1262,7 +1262,7 @@ instance.web.Client = instance.web.Widget.extend({ bind_events: function() { var self = this; this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() { - $(this).attr('data-toggle', 'tooltip').tooltip().trigger('mouseenter'); + $(this).attr('data-toggle', 'tooltip').tooltip({placement: 'bottom', html: true}).trigger('mouseenter'); }); this.$el.on('click', '.oe_dropdown_toggle', function(ev) { ev.preventDefault(); diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index c3ef682bfcc..50535150bf3 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -400,7 +400,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.query = new my.SearchQuery() .on('add change reset remove', this.proxy('do_search')) .on('add change reset remove', this.proxy('renderFacets')); - + $('.oe_searchview_unfold_drawer').tooltip({html: true}); if (this.options.hidden) { this.$el.hide(); } -- cgit v1.2.3 From ff5cc4d5d37e0580cb9ee20d963ad99a51389d21 Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Thu, 5 Dec 2013 12:19:03 +0530 Subject: [IMP]Container added for tooltip. bzr revid: bth@tinyerp.com-20131205064903-222sb09tcsy4x79u --- addons/web/static/src/css/base.css | 3 --- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/views.js | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 6188b3fc26e..b4e6d4a24b2 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -641,9 +641,6 @@ left: 12% !important; margin-top: 0.5px; } -.tooltip.bottom { - padding: 5px 0 !important; -} .openerp .oe_notebook { margin: 8px 0; padding: 0 16px; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 848f9e1ec3c..b80dfff695a 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1262,7 +1262,7 @@ instance.web.Client = instance.web.Widget.extend({ bind_events: function() { var self = this; this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() { - $(this).attr('data-toggle', 'tooltip').tooltip({placement: 'bottom', html: true}).trigger('mouseenter'); + $(this).attr('data-toggle', 'tooltip').tooltip({placement: 'bottom', html: true, container: 'body'}).trigger('mouseenter'); }); this.$el.on('click', '.oe_dropdown_toggle', function(ev) { ev.preventDefault(); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index f9e8018b183..ed81ccc253f 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1159,6 +1159,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ self.$("[title]").tooltip({ 'html': true, + 'container': 'body', 'delayIn': 500, }); }, -- cgit v1.2.3 From 63d66614c55b9e4947e84947cd210985362acf38 Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Thu, 5 Dec 2013 13:04:31 +0530 Subject: [IMP]Add attribute. bzr revid: bth@tinyerp.com-20131205073431-rcmnwyph2fn0hzu8 --- addons/web/static/src/js/search.js | 1 + addons/web/static/src/js/views.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 50535150bf3..0af8b451312 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -400,6 +400,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.query = new my.SearchQuery() .on('add change reset remove', this.proxy('do_search')) .on('add change reset remove', this.proxy('renderFacets')); + $('.oe_searchview_unfold_drawer').attr('data-toggle', 'tooltip'); $('.oe_searchview_unfold_drawer').tooltip({html: true}); if (this.options.hidden) { this.$el.hide(); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index ed81ccc253f..625eb4799eb 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1156,7 +1156,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ this.$('.oe_form_dropdown_section').each(function() { $(this).toggle(!!$(this).find('li').length); }); - + self.$("[title]").attr('data-toggle', 'tooltip'); self.$("[title]").tooltip({ 'html': true, 'container': 'body', -- cgit v1.2.3 From 21ac480edfbe3c01251aa300639e45242dcdffc9 Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Thu, 5 Dec 2013 16:47:14 +0530 Subject: [IMP]Add tooltip in kanban record and search view. bzr revid: bth@tinyerp.com-20131205111714-zat05ycom5wtjzfd --- addons/web/static/src/js/search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 0af8b451312..9022c8dbbe7 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1841,7 +1841,10 @@ instance.web.search.Filters = instance.web.search.Input.extend({ return $.when( this.render_column(col1, $('
').appendTo(this.$el)), - this.render_column(col2, $('
').appendTo(this.$el))); + this.render_column(col2, $('
').appendTo(this.$el))).then(function () { + self.$el.children().find('[title]').attr('data-toggle', 'tooltip'); + self.$el.children().find('[title]').tooltip({placement: 'bottom', html: true, container: 'body'}); + }); }, render_column: function (column, $el) { return $.when.apply(null, _(column).map(function (group) { -- cgit v1.2.3 From 188d42650009a5a4672b847158b481a43e7e5056 Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Fri, 6 Dec 2013 10:57:56 +0530 Subject: [IMP]Add sass changes. bzr revid: bth@tinyerp.com-20131206052756-bqizhcsf2jwjn05k --- addons/web/static/src/css/base.sass | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e9a51370192..cf72a287549 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -534,6 +534,7 @@ $sheet-padding: 16px // Tooltips {{{ &.oe_tooltip font-size: 12px + background-color: transparent .oe_tooltip_string color: #FD5 font-weight: bold @@ -557,6 +558,11 @@ $sheet-padding: 16px cursor: pointer .oe_tooltip_message max-width: 310px + .tooltip-inner + text-align: left !important + .tooltip.bottom .tooltip-arrow + left: 12% !important + margin-top: 0.5px // }}} // Notebook {{{ .oe_notebook -- cgit v1.2.3 From 6ccb6423ead8a24c4dfe3d2033454d91acc168ec Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Fri, 6 Dec 2013 11:51:52 +0530 Subject: [IMP]Destroy tooltip. bzr revid: bth@tinyerp.com-20131206062152-15fi8v8xokyux40m --- addons/web/static/src/js/views.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 625eb4799eb..63aba1dbde5 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -586,6 +586,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ this.$el.find('.oe_view_manager_switch a').attr('data-toggle', 'tooltip'); this.$el.find('.oe_view_manager_switch a').click(function() { self.switch_mode($(this).data('view-type')); + $(this).tooltip('destroy'); }).tooltip({ container: 'body', html: true, -- cgit v1.2.3 From ec96bb513b89c100873a0b7554bbd8941ba52b6e Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Wed, 11 Dec 2013 16:30:30 +0530 Subject: [IMP]Tooltip when field have help and on debug mode. bzr revid: bth@tinyerp.com-20131211110030-tz3jf992ndmjgqe9 --- addons/web/static/src/js/view_form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 05538fad897..d10bd7a97a5 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2104,8 +2104,9 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w this.$el.find('.oe_field_translate').click(this.on_translate); } this.$label = this.view ? this.view.$el.find('label[for=' + this.id_for_label + ']') : $(); - if (instance.session.debug) { + if (this.field.help || instance.session.debug) this.do_attach_tooltip(this, this.$label[0] || this.$el); + if (instance.session.debug) { this.$label.off('dblclick').on('dblclick', function() { console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view); window.w = self; -- cgit v1.2.3 From 40a4a06d068c639b873e3936efb58159f1dd7709 Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Tue, 17 Dec 2013 13:01:58 +0530 Subject: [IMP]improved css for tooltip bottom, bottom arrow, text alignment. bzr revid: kch@tinyerp.com-20131217073158-zjy4wbxenchxk2ax --- addons/web/static/src/css/base.css | 20 ++++++++++---------- addons/web/static/src/css/base.sass | 12 +++++++----- 2 files changed, 17 insertions(+), 15 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b4e6d4a24b2..25d2bf2441f 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -634,13 +634,6 @@ .openerp.oe_tooltip .oe_tooltip_message { max-width: 310px; } -.tooltip-inner { - text-align: left !important; -} -.tooltip.bottom .tooltip-arrow { - left: 12% !important; - margin-top: 0.5px; -} .openerp .oe_notebook { margin: 8px 0; padding: 0 16px; @@ -2298,7 +2291,7 @@ } .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { font-size: 80%; - color: darkGreen; + color: darkgreen; vertical-align: top; position: relative; top: -4px; @@ -3442,7 +3435,6 @@ div.ui-widget-overlay { overflow: hidden !important; } } - .nav li > a { padding: 3px 4px 2px 18px; color: #4c4c4c; @@ -3471,6 +3463,14 @@ div.ui-widget-overlay { background-color: #7c7bad; } +.tooltip-inner { + text-align: left; +} + +.tooltip.bottom .tooltip-arrow { + left: 35%; +} + button, body { line-height: normal; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index cf72a287549..541a7f66d88 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -558,11 +558,6 @@ $sheet-padding: 16px cursor: pointer .oe_tooltip_message max-width: 310px - .tooltip-inner - text-align: left !important - .tooltip.bottom .tooltip-arrow - left: 12% !important - margin-top: 0.5px // }}} // Notebook {{{ .oe_notebook @@ -2770,6 +2765,13 @@ div.ui-widget-overlay background-color: #7c7bad // End of customize +// Customize bootstrap3 for tooltip +.tooltip-inner + text-align: left +.tooltip.bottom .tooltip-arrow + left: 35% +// End of customize + // Customize for global tags button, body line-height: normal -- cgit v1.2.3 From 3fcd2e2440a7a5e87f7451453decf1462000ea35 Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Tue, 17 Dec 2013 15:05:46 +0530 Subject: [IMP]Improved code for set tooltip placement on top or bottom on the basis of display area. bzr revid: kch@tinyerp.com-20131217093546-49lg5i0rm1kx9oli --- addons/web/static/src/css/base.css | 4 ++-- addons/web/static/src/css/base.sass | 4 ++-- addons/web/static/src/js/search.js | 2 +- addons/web/static/src/js/view_form.js | 7 ++++++- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 25d2bf2441f..06239a389cd 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3464,11 +3464,11 @@ div.ui-widget-overlay { } .tooltip-inner { - text-align: left; + text-align: left !important; } .tooltip.bottom .tooltip-arrow { - left: 35%; + left: 35% !important; } button, body { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 541a7f66d88..e74fae44206 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2767,9 +2767,9 @@ div.ui-widget-overlay // Customize bootstrap3 for tooltip .tooltip-inner - text-align: left + text-align: left !important .tooltip.bottom .tooltip-arrow - left: 35% + left: 35% !important // End of customize // Customize for global tags diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 1cc2b4815d0..994673021a3 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -401,7 +401,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea .on('add change reset remove', this.proxy('do_search')) .on('add change reset remove', this.proxy('renderFacets')); $('.oe_searchview_unfold_drawer').attr('data-toggle', 'tooltip'); - $('.oe_searchview_unfold_drawer').tooltip({html: true}); + $('.oe_searchview_unfold_drawer').tooltip({placement: 'bottom', html: true}); if (this.options.hidden) { this.$el.hide(); } diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d10bd7a97a5..7ffbffd44f3 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1862,7 +1862,12 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi }); }, container: 'body', - placement: 'bottom', + placement: function(tip, trigger) { //dynamic set position + var offset = $(trigger).offset(); + var vert = 0.5 * $(document).outerHeight() - offset.top; + var vertPlacement = vert > 0 ? 'bottom' : 'top'; + return vertPlacement; + }, html: true, opacity: 0.85, }, options || {}); -- cgit v1.2.3 From e6112472cede1ee52497e8f91541fbaf8d5a7531 Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Tue, 17 Dec 2013 15:11:57 +0530 Subject: [FIX]css issue. bzr revid: kch@tinyerp.com-20131217094157-i45wv6xs1uz38kin --- addons/web/static/src/css/base.css | 3 ++- addons/web/static/src/css/base.sass | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 06239a389cd..008d811f30c 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3465,10 +3465,11 @@ div.ui-widget-overlay { .tooltip-inner { text-align: left !important; + max-width: 250px; } .tooltip.bottom .tooltip-arrow { - left: 35% !important; + left: 50%; } button, body { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e74fae44206..549b89e2b21 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2768,8 +2768,9 @@ div.ui-widget-overlay // Customize bootstrap3 for tooltip .tooltip-inner text-align: left !important + max-width: 250px .tooltip.bottom .tooltip-arrow - left: 35% !important + left: 50% // End of customize // Customize for global tags -- cgit v1.2.3 From 00362f60c987eb0ca44dc65902f4f9a0960af90a Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Wed, 18 Dec 2013 13:04:40 +0530 Subject: [IMP]customize bootstrap tooltip classes. bzr revid: kch@tinyerp.com-20131218073440-c7sfdn0jfw0cw83n --- addons/web/static/src/css/base.css | 80 +++++++++++++++++++------------------ addons/web/static/src/css/base.sass | 68 ++++++++++++++++--------------- 2 files changed, 76 insertions(+), 72 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 008d811f30c..4dce5647458 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -599,41 +599,6 @@ font-style: italic; text-decoration: none; } -.openerp.oe_tooltip { - font-size: 12px; - background-color: transparent; -} -.openerp.oe_tooltip .oe_tooltip_string { - color: #ffdd55; - font-weight: bold; - font-size: 13px; -} -.openerp.oe_tooltip .oe_tooltip_help { - white-space: pre-wrap; -} -.openerp.oe_tooltip .oe_tooltip_technical { - padding: 0 0 4px 0; - margin: 5px 0 0 15px; -} -.openerp.oe_tooltip .oe_tooltip_technical li { - list-style: circle; -} -.openerp.oe_tooltip .oe_tooltip_technical_title { - font-weight: bold; -} -.openerp.oe_tooltip .oe_tooltip_close { - margin: -5px 0 0 2px; - cursor: default; - float: right; - color: white; -} -.openerp.oe_tooltip .oe_tooltip_close:hover { - color: #999999; - cursor: pointer; -} -.openerp.oe_tooltip .oe_tooltip_message { - max-width: 310px; -} .openerp .oe_notebook { margin: 8px 0; padding: 0 16px; @@ -3463,13 +3428,50 @@ div.ui-widget-overlay { background-color: #7c7bad; } -.tooltip-inner { +.tooltip { + padding: 0; + margin: 0; + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; + color: #4c4c4c; + font-size: 12px; + background: white; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); + background-color: transparent; +} +.tooltip .tooltip-inner { text-align: left !important; max-width: 250px; } - -.tooltip.bottom .tooltip-arrow { - left: 50%; +.tooltip .tooltip-inner .oe_tooltip_string { + color: #ffdd55; + font-weight: bold; + font-size: 13px; +} +.tooltip .tooltip-inner .oe_tooltip_help { + white-space: pre-wrap; +} +.tooltip .tooltip-inner .oe_tooltip_technical { + padding: 0 0 4px 0; + margin: 5px 0 0 15px; +} +.tooltip .tooltip-inner .oe_tooltip_technical li { + list-style: circle; +} +.tooltip .tooltip-inner .oe_tooltip_technical_title { + font-weight: bold; +} +.tooltip .tooltip-inner .oe_tooltip_close { + margin: -5px 0 0 2px; + cursor: default; + float: right; + color: white; +} +.tooltip .tooltip-inner .oe_tooltip_close:hover { + color: #999999; + cursor: pointer; +} +.tooltip .tooltip-inner .oe_tooltip_message { + max-width: 310px; } button, body { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 549b89e2b21..941ce32231c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -531,34 +531,6 @@ $sheet-padding: 16px text-decoration: none margin-bottom: 1px // }}} - // Tooltips {{{ - &.oe_tooltip - font-size: 12px - background-color: transparent - .oe_tooltip_string - color: #FD5 - font-weight: bold - font-size: 13px - .oe_tooltip_help - white-space: pre-wrap - .oe_tooltip_technical - padding: 0 0 4px 0 - margin: 5px 0 0 15px - li - list-style: circle - .oe_tooltip_technical_title - font-weight: bold - .oe_tooltip_close - margin: -5px 0 0 2px - cursor: default - float: right - color: white - &:hover - color: #999 - cursor: pointer - .oe_tooltip_message - max-width: 310px - // }}} // Notebook {{{ .oe_notebook margin: 8px 0 @@ -2766,11 +2738,41 @@ div.ui-widget-overlay // End of customize // Customize bootstrap3 for tooltip -.tooltip-inner - text-align: left !important - max-width: 250px -.tooltip.bottom .tooltip-arrow - left: 50% +.tooltip + padding: 0 + margin: 0 + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif + color: #4c4c4c + font-size: 12px + background: white + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) + background-color: transparent + .tooltip-inner + text-align: left !important + max-width: 250px + .oe_tooltip_string + color: #FD5 + font-weight: bold + font-size: 13px + .oe_tooltip_help + white-space: pre-wrap + .oe_tooltip_technical + padding: 0 0 4px 0 + margin: 5px 0 0 15px + li + list-style: circle + .oe_tooltip_technical_title + font-weight: bold + .oe_tooltip_close + margin: -5px 0 0 2px + cursor: default + float: right + color: white + &:hover + color: #999 + cursor: pointer + .oe_tooltip_message + max-width: 310px // End of customize // Customize for global tags -- cgit v1.2.3 From 5e5483bde4bb6329aab389f68f09121426e43312 Mon Sep 17 00:00:00 2001 From: "Vidhin Mehta (OpenERP)" Date: Fri, 20 Dec 2013 13:02:41 +0530 Subject: [FIX]for dialog box stick to page. bzr revid: vme@tinyerp.com-20131220073241-xi7v47jecgewapw2 --- addons/web/static/src/js/chrome.js | 5 ++++- addons/web/static/src/js/view_form.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index b80dfff695a..a87af20af69 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -238,6 +238,10 @@ instance.web.Dialog = instance.web.Widget.extend({ if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(dialog)")) { this.$el.dialog('destroy'); } + //For Remove tooltip from dialog box when destroy + //Bad fix, bootstrap mouseleave method call very late + //before that this.$el and its contained removed because that tooltip sticks on page. + $($.find('.tooltip.fade.in')).remove(); this._super(); } }); @@ -1287,7 +1291,6 @@ instance.web.Client = instance.web.Widget.extend({ }); instance.web.bus.on('click', this, function(ev) { $.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 7ffbffd44f3..683794cac68 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1851,6 +1851,8 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi widget = widget || this; trigger = trigger || this.$el; options = _.extend({ + delay: { show: 750, hide: 0 }, + trigger: 'hover', title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { -- cgit v1.2.3 From b987405134e09aeacabbeeeb3edbdf3fe64ce065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Mar 2014 10:29:55 +0100 Subject: [IMP] Sidebar: added a new section for the sidebar, the buttons section. When having actions to display in the 'more' menu and if the action id is present in the context, get the action out of the menu to display a specific red button. This is used to highlight some specific action to do in a given flow. For example when going to a list view from a button, with an action that should be the next one to perform, it allows to display the button once at least one record is selected. bzr revid: tde@openerp.com-20140318092955-vym3d7xkl3mmf62i --- addons/web/static/src/js/views.js | 43 +++++++++++++++++++++++++------------- addons/web/static/src/xml/base.xml | 8 ++++++- 2 files changed, 35 insertions(+), 16 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index c9229c3c70a..829a6251404 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1117,10 +1117,12 @@ instance.web.Sidebar = instance.web.Widget.extend({ this._super(parent); var view = this.getParent(); this.sections = [ + { 'name': 'buttons', 'label': _t('Button'), }, { 'name' : 'print', 'label' : _t('Print'), }, { 'name' : 'other', 'label' : _t('More'), } ]; this.items = { + 'buttons': [], 'print' : [], 'other' : [] }; @@ -1132,22 +1134,24 @@ instance.web.Sidebar = instance.web.Widget.extend({ }); }, start: function() { - var self = this; this._super(this); this.redraw(); - this.$el.on('click','.oe_dropdown_menu li a', function(event) { - var section = $(this).data('section'); - var index = $(this).data('index'); - var item = self.items[section][index]; - if (item.callback) { - item.callback.apply(self, [item]); - } else if (item.action) { - self.on_item_action_clicked(item); - } else if (item.url) { - return true; - } - event.preventDefault(); - }); + this.$el.on('click', 'button.oe_sidebar_button', this.on_item_click); + this.$el.on('click','.oe_dropdown_menu li a', this.on_item_click); + }, + on_item_click: function (event) { + var self = this; + var section = $(event.currentTarget).data('section'); + var index = $(event.currentTarget).data('index'); + var item = self.items[section][index]; + if (item.callback) { + item.callback.apply(self, [item]); + } else if (item.action) { + self.on_item_action_clicked(item); + } else if (item.url) { + return true; + } + event.preventDefault(); }, redraw: function() { var self = this; @@ -1197,17 +1201,26 @@ instance.web.Sidebar = instance.web.Widget.extend({ }, add_toolbar: function(toolbar) { var self = this; + var context = self.getParent().dataset.context; // not sure this is the correct way to find the context + var highlighted_act_ids = context['view_manager_highlight'] || []; _.each(['print','action','relate'], function(type) { var items = toolbar[type]; if (items) { for (var i = 0; i < items.length; i++) { + var section_code = 'other'; + if (highlighted_act_ids && _.indexOf(highlighted_act_ids, items[i]['id']) != -1) { + section_code = 'buttons'; + } + else if (type == 'print') { + section_code = 'print'; + } items[i] = { label: items[i]['name'], action: items[i], classname: 'oe_sidebar_' + type }; + self.add_items(section_code, [items[i]]); } - self.add_items(type=='print' ? 'print' : 'other', items); } }); }, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7ba06b69095..6f1c98cdda2 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -599,10 +599,16 @@
- + + +
  • -- cgit v1.2.3 From 1a086bca821df7fa95fb00d6a6474061cd444926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Mar 2014 11:25:01 +0100 Subject: [IMP] sidebar in list view: context should be the one of the dataset, allowing context propagation, not void default context. bzr revid: tde@openerp.com-20140318102501-pi6qcaz1zbu71tsh --- addons/web/static/src/js/views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 829a6251404..e24de77ea4f 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1531,7 +1531,7 @@ instance.web.View = instance.web.Widget.extend({ new instance.web.DataExport(this, this.dataset).open(); }, sidebar_eval_context: function () { - return $.when({}); + return $.when(new instance.web.CompoundContext(this.dataset.get_context())); }, /** * Asks the view to reload itself, if the reloading is asynchronous should -- cgit v1.2.3 From 2f0b59be37c2878aa3efcaa075a972eb80300469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 20 Mar 2014 18:39:07 +0100 Subject: [IMP] list_view: allow displaying string-based buttons in list view and not only img-based buttons. bzr revid: tde@openerp.com-20140320173907-5b02atnispbznqmj --- addons/web/static/src/css/base.css | 2 +- addons/web/static/src/css/base.sass | 2 +- addons/web/static/src/js/view_list.js | 4 ++-- addons/web/static/src/xml/base.xml | 12 +++++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 6a20442ed41..3996579e02a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2877,7 +2877,7 @@ padding: 3px 6px; white-space: pre-line; } -.openerp .oe_list_content > tbody > tr > td > button, .openerp .oe_list_content > tbody > tr > th > button { +.openerp .oe_list_content > tbody > tr > td > button.btn_img, .openerp .oe_list_content > tbody > tr > th > button.btn_img { border: none; background: transparent; padding: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 38a47eed1c5..b08427e0832 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2312,7 +2312,7 @@ $sheet-padding: 16px padding: 3px 6px white-space: pre-line > td, > th - > button + > button.btn_img border: none background: transparent padding: 0 diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 7426c70838c..d9a44fb991d 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -2260,8 +2260,8 @@ instance.web.list.Button = instance.web.list.Column.extend({ attrs = this.modifiers_for(row_data); } if (attrs.invisible) { return ''; } - - return QWeb.render('ListView.row.button', { + var template = this.icon && 'ListView.row.button' || 'ListView.row.text_button'; + return QWeb.render(template, { widget: this, prefix: instance.session.prefix, disabled: attrs.readonly diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 6f1c98cdda2..ded573f2af3 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -785,11 +785,17 @@ + + t-att-class="disabled ? 'oe_list_button_disabled btn_img' : 'btn_img'"> + +