Merge lp:~openerp-dev/openerp-web/trunk-tipsy-to-boostrap into lp:openerp-web

Proposed by Bhumi Thakkar (Open ERP)
Status: Merged
Merged at revision: 3983
Proposed branch: lp:~openerp-dev/openerp-web/trunk-tipsy-to-boostrap
Merge into: lp:openerp-web
Diff against target: 744 lines (+132/-367)
12 files modified
addons/web/__openerp__.py (+0/-2)
addons/web/static/lib/jquery.tipsy/jquery.tipsy.js (+0/-250)
addons/web/static/lib/jquery.tipsy/tipsy.css (+0/-25)
addons/web/static/src/css/base.css (+48/-37)
addons/web/static/src/css/base.sass (+38/-27)
addons/web/static/src/js/chrome.js (+7/-3)
addons/web/static/src/js/search.js (+6/-2)
addons/web/static/src/js/view_form.js (+14/-8)
addons/web/static/src/js/views.js (+10/-3)
addons/web_gantt/static/src/js/gantt.js (+1/-0)
addons/web_kanban/static/src/js/kanban.js (+7/-9)
addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-tipsy-to-boostrap
Reviewer Review Type Date Requested Status
OpenERP R&D Web Team Pending
Review via email: mp+198203@code.launchpad.net

Description of the change

Hello,

   Added bootstrap tooltip and removed tipsy tooltip.

Thanks.

To post a comment you must log in.
3913. By Bhumi Thakkar (Open ERP)

[MERGE]With trunk.

3914. By Bhumi Thakkar (Open ERP)

[IMP]Tooltip when field have help and on debug mode.

3915. By Bhumi Thakkar (Open ERP)

[IMP]\n replaced by <br />.

3916. By Bhumi Thakkar (Open ERP)

[MERGE]With trunk.

3917. By Kunal Chavda

[MERGE]with latest.

3918. By Kunal Chavda

[REM]removed tooltip.js which is not needed. tooltip included in bootstrap.js.

3919. By Kunal Chavda

[IMP]improved css for tooltip bottom, bottom arrow, text alignment.

3920. By Kunal Chavda

[IMP]Improved code for set tooltip placement on top or bottom on the basis of display area.

3921. By Kunal Chavda

[FIX]css issue.

3922. By Kunal Chavda

[FIX]forgot to uncomment code.

3923. By Kunal Chavda

[IMP]customize bootstrap tooltip classes.

3924. By Kunal Chavda

[REM]removed tipsy library.

3925. By Vidhin Mehta (OpenERP)

[FIX]for dialog box stick to page.

3926. By Vidhin Mehta (OpenERP)

[MERGE]Trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/__openerp__.py'
2--- addons/web/__openerp__.py 2013-12-19 13:40:55 +0000
3+++ addons/web/__openerp__.py 2013-12-20 07:34:41 +0000
4@@ -33,7 +33,6 @@
5 "static/lib/jquery.ui.notify/js/jquery.notify.js",
6 "static/lib/jquery.deferred-queue/jquery.deferred-queue.js",
7 "static/lib/jquery.scrollTo/jquery.scrollTo-min.js",
8- "static/lib/jquery.tipsy/jquery.tipsy.js",
9 "static/lib/jquery.textext/jquery.textext.js",
10 "static/lib/jquery.timeago/jquery.timeago.js",
11 "static/lib/bootstrap/js/bootstrap.js",
12@@ -63,7 +62,6 @@
13 "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",
14 "static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css",
15 "static/lib/jquery.ui.notify/css/ui.notify.css",
16- "static/lib/jquery.tipsy/tipsy.css",
17 "static/lib/jquery.textext/jquery.textext.css",
18 "static/lib/fontawesome/css/font-awesome.css",
19 "static/lib/bootstrap/css/bootstrap.css",
20
21=== removed directory 'addons/web/static/lib/jquery.tipsy'
22=== removed file 'addons/web/static/lib/jquery.tipsy/jquery.tipsy.js'
23--- addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 2012-11-15 16:41:32 +0000
24+++ addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 1970-01-01 00:00:00 +0000
25@@ -1,250 +0,0 @@
26-// tipsy, facebook style tooltips for jquery
27-// version 1.0.0a
28-// (c) 2008-2010 jason frame [jason@onehackoranother.com]
29-// released under the MIT license
30-
31-(function($) {
32-
33- function maybeCall(thing, ctx) {
34- return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
35- };
36-
37- function Tipsy(element, options) {
38- this.$element = $(element);
39- this.options = options;
40- this.enabled = true;
41- this.fixTitle();
42- };
43-
44- Tipsy.prototype = {
45- show: function() {
46- $.fn.tipsy.clear();
47- if (!this.$element.parent().length) {
48- return;
49- }
50- var title = this.getTitle();
51- if (title && this.enabled) {
52- var $tip = this.tip();
53-
54- $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
55- $tip[0].className = 'tipsy '; // reset classname in case of dynamic gravity
56- $tip.openerpClass('oe_tooltip');
57- $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
58-
59- var pos = $.extend({}, this.$element.offset(), {
60- width: this.$element[0].offsetWidth,
61- height: this.$element[0].offsetHeight
62- });
63-
64- var actualWidth = $tip[0].offsetWidth,
65- actualHeight = $tip[0].offsetHeight,
66- gravity = maybeCall(this.options.gravity, this.$element[0]);
67-
68- var tp;
69- switch (gravity.charAt(0)) {
70- case 'n':
71- tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
72- break;
73- case 's':
74- tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
75- break;
76- case 'e':
77- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
78- break;
79- case 'w':
80- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
81- break;
82- }
83-
84- if (gravity.length == 2) {
85- if (gravity.charAt(1) == 'w') {
86- tp.left = pos.left + pos.width / 2 - 15;
87- } else {
88- tp.left = pos.left + pos.width / 2 - actualWidth + 15;
89- }
90- }
91-
92- $tip.css(tp).addClass('tipsy-' + gravity);
93- $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
94- if (this.options.className) {
95- $tip.addClass(maybeCall(this.options.className, this.$element[0]));
96- }
97-
98- if (this.options.fade) {
99- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
100- } else {
101- $tip.css({visibility: 'visible', opacity: this.options.opacity});
102- }
103- }
104- },
105-
106- hide: function() {
107- if (this.options.fade) {
108- this.tip().stop().fadeOut(function() { $(this).remove(); });
109- } else {
110- this.tip().remove();
111- }
112- },
113-
114- fixTitle: function() {
115- var $e = this.$element;
116- if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
117- $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
118- }
119- },
120-
121- getTitle: function() {
122- var title, $e = this.$element, o = this.options;
123- this.fixTitle();
124- var title, o = this.options;
125- if (typeof o.title == 'string') {
126- title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
127- } else if (typeof o.title == 'function') {
128- title = o.title.call($e[0]);
129- }
130- title = ('' + title).replace(/(^\s*|\s*$)/, "");
131- return title || o.fallback;
132- },
133-
134- tip: function() {
135- if (!this.$tip) {
136- this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
137- }
138- return this.$tip;
139- },
140-
141- validate: function() {
142- if (!this.$element[0].parentNode) {
143- this.hide();
144- this.$element = null;
145- this.options = null;
146- }
147- },
148-
149- enable: function() { this.enabled = true; },
150- disable: function() { this.enabled = false; },
151- toggleEnabled: function() { this.enabled = !this.enabled; }
152- };
153-
154- $.fn.tipsy = function(options) {
155-
156- if (options === true) {
157- return this.data('tipsy');
158- } else if (typeof options == 'string') {
159- var tipsy = this.data('tipsy');
160- if (tipsy) tipsy[options]();
161- return this;
162- }
163-
164- options = $.extend({}, $.fn.tipsy.defaults, options);
165-
166- function get(ele) {
167- var tipsy = $.data(ele, 'tipsy');
168- if (!tipsy) {
169- tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
170- $.data(ele, 'tipsy', tipsy);
171- }
172- return tipsy;
173- }
174-
175- function enter() {
176- var tipsy = get(this);
177- tipsy.hoverState = 'in';
178- if (options.delayIn == 0) {
179- tipsy.show();
180- } else {
181- tipsy.fixTitle();
182- setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
183- }
184- };
185-
186- function leave() {
187- var tipsy = get(this);
188- tipsy.hoverState = 'out';
189- if (options.delayOut == 0) {
190- tipsy.hide();
191- } else {
192- setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
193- }
194- };
195-
196- if (!options.live) this.each(function() { get(this); });
197-
198- if (options.trigger != 'manual') {
199- var binder = options.live ? 'live' : 'bind',
200- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
201- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
202- this[binder](eventIn, enter)[binder](eventOut, leave);
203- }
204-
205- return this;
206-
207- };
208-
209- $.fn.tipsy.clear = function() {
210- $('div.tipsy').stop().remove();
211- }
212-
213- $.fn.tipsy.defaults = {
214- className: null,
215- delayIn: 0,
216- delayOut: 0,
217- fade: false,
218- fallback: '',
219- gravity: 'n',
220- html: false,
221- live: false,
222- offset: 0,
223- opacity: 0.8,
224- title: 'title',
225- trigger: 'hover'
226- };
227-
228- // Overwrite this method to provide options on a per-element basis.
229- // For example, you could store the gravity in a 'tipsy-gravity' attribute:
230- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
231- // (remember - do not modify 'options' in place!)
232- $.fn.tipsy.elementOptions = function(ele, options) {
233- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
234- };
235-
236- $.fn.tipsy.autoNS = function() {
237- return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
238- };
239-
240- $.fn.tipsy.autoWE = function() {
241- return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
242- };
243-
244- /**
245- * yields a closure of the supplied parameters, producing a function that takes
246- * no arguments and is suitable for use as an autogravity function like so:
247- *
248- * @param margin (int) - distance from the viewable region edge that an
249- * element should be before setting its tooltip's gravity to be away
250- * from that edge.
251- * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
252- * if there are no viewable region edges effecting the tooltip's
253- * gravity. It will try to vary from this minimally, for example,
254- * if 'sw' is preferred and an element is near the right viewable
255- * region edge, but not the top edge, it will set the gravity for
256- * that element's tooltip to be 'se', preserving the southern
257- * component.
258- */
259- $.fn.tipsy.autoBounds = function(margin, prefer) {
260- return function() {
261- var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
262- boundTop = $(document).scrollTop() + margin,
263- boundLeft = $(document).scrollLeft() + margin,
264- $this = $(this);
265-
266- if ($this.offset().top < boundTop) dir.ns = 'n';
267- if ($this.offset().left < boundLeft) dir.ew = 'w';
268- if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
269- if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
270-
271- return dir.ns + (dir.ew ? dir.ew : '');
272- }
273- };
274-
275-})(jQuery);
276
277=== removed file 'addons/web/static/lib/jquery.tipsy/tipsy.css'
278--- addons/web/static/lib/jquery.tipsy/tipsy.css 2012-09-21 14:09:32 +0000
279+++ addons/web/static/lib/jquery.tipsy/tipsy.css 1970-01-01 00:00:00 +0000
280@@ -1,25 +0,0 @@
281-.tipsy { font-size: 90%; position: absolute; padding: 5px; z-index: 100000; overflow: hidden;}
282- .tipsy-inner { background-color: #000; color: #FFF; max-width: 500px; padding: 5px 8px 4px 8px; }
283-
284- /* Rounded corners */
285- .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
286-
287- /* Uncomment for shadow */
288- .tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }
289-
290- .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
291-
292- /* Rules to colour arrows */
293- .tipsy-arrow-n { border-bottom-color: #000; }
294- .tipsy-arrow-s { border-top-color: #000; }
295- .tipsy-arrow-e { border-left-color: #000; }
296- .tipsy-arrow-w { border-right-color: #000; }
297-
298- .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
299- .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
300- .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
301- .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
302- .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
303- .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
304- .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
305- .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
306
307=== modified file 'addons/web/static/src/css/base.css'
308--- addons/web/static/src/css/base.css 2013-12-19 13:40:55 +0000
309+++ addons/web/static/src/css/base.css 2013-12-20 07:34:41 +0000
310@@ -1,4 +1,4 @@
311-@charset "utf-8";
312+@charset "UTF-8";
313 @font-face {
314 font-family: "mnmliconsRegular";
315 src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");
316@@ -599,40 +599,6 @@
317 font-style: italic;
318 text-decoration: none;
319 }
320-.openerp.oe_tooltip {
321- font-size: 12px;
322-}
323-.openerp.oe_tooltip .oe_tooltip_string {
324- color: #ffdd55;
325- font-weight: bold;
326- font-size: 13px;
327-}
328-.openerp.oe_tooltip .oe_tooltip_help {
329- white-space: pre-wrap;
330-}
331-.openerp.oe_tooltip .oe_tooltip_technical {
332- padding: 0 0 4px 0;
333- margin: 5px 0 0 15px;
334-}
335-.openerp.oe_tooltip .oe_tooltip_technical li {
336- list-style: circle;
337-}
338-.openerp.oe_tooltip .oe_tooltip_technical_title {
339- font-weight: bold;
340-}
341-.openerp.oe_tooltip .oe_tooltip_close {
342- margin: -5px 0 0 2px;
343- cursor: default;
344- float: right;
345- color: white;
346-}
347-.openerp.oe_tooltip .oe_tooltip_close:hover {
348- color: #999999;
349- cursor: pointer;
350-}
351-.openerp.oe_tooltip .oe_tooltip_message {
352- max-width: 310px;
353-}
354 .openerp .oe_notebook {
355 margin: 8px 0;
356 padding: 0 16px;
357@@ -2290,7 +2256,7 @@
358 }
359 .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
360 font-size: 80%;
361- color: darkGreen;
362+ color: darkgreen;
363 vertical-align: top;
364 position: relative;
365 top: -4px;
366@@ -3434,7 +3400,6 @@
367 overflow: hidden !important;
368 }
369 }
370-
371 .nav li > a {
372 padding: 3px 4px 2px 18px;
373 color: #4c4c4c;
374@@ -3463,6 +3428,52 @@
375 background-color: #7c7bad;
376 }
377
378+.tooltip {
379+ padding: 0;
380+ margin: 0;
381+ font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
382+ color: #4c4c4c;
383+ font-size: 12px;
384+ background: white;
385+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
386+ background-color: transparent;
387+}
388+.tooltip .tooltip-inner {
389+ text-align: left !important;
390+ max-width: 250px;
391+}
392+.tooltip .tooltip-inner .oe_tooltip_string {
393+ color: #ffdd55;
394+ font-weight: bold;
395+ font-size: 13px;
396+}
397+.tooltip .tooltip-inner .oe_tooltip_help {
398+ white-space: pre-wrap;
399+}
400+.tooltip .tooltip-inner .oe_tooltip_technical {
401+ padding: 0 0 4px 0;
402+ margin: 5px 0 0 15px;
403+}
404+.tooltip .tooltip-inner .oe_tooltip_technical li {
405+ list-style: circle;
406+}
407+.tooltip .tooltip-inner .oe_tooltip_technical_title {
408+ font-weight: bold;
409+}
410+.tooltip .tooltip-inner .oe_tooltip_close {
411+ margin: -5px 0 0 2px;
412+ cursor: default;
413+ float: right;
414+ color: white;
415+}
416+.tooltip .tooltip-inner .oe_tooltip_close:hover {
417+ color: #999999;
418+ cursor: pointer;
419+}
420+.tooltip .tooltip-inner .oe_tooltip_message {
421+ max-width: 310px;
422+}
423+
424 button, body {
425 line-height: normal;
426 }
427
428=== modified file 'addons/web/static/src/css/base.sass'
429--- addons/web/static/src/css/base.sass 2013-12-19 13:40:55 +0000
430+++ addons/web/static/src/css/base.sass 2013-12-20 07:34:41 +0000
431@@ -531,33 +531,6 @@
432 text-decoration: none
433 margin-bottom: 1px
434 // }}}
435- // Tooltips {{{
436- &.oe_tooltip
437- font-size: 12px
438- .oe_tooltip_string
439- color: #FD5
440- font-weight: bold
441- font-size: 13px
442- .oe_tooltip_help
443- white-space: pre-wrap
444- .oe_tooltip_technical
445- padding: 0 0 4px 0
446- margin: 5px 0 0 15px
447- li
448- list-style: circle
449- .oe_tooltip_technical_title
450- font-weight: bold
451- .oe_tooltip_close
452- margin: -5px 0 0 2px
453- cursor: default
454- float: right
455- color: white
456- &:hover
457- color: #999
458- cursor: pointer
459- .oe_tooltip_message
460- max-width: 310px
461- // }}}
462 // Notebook {{{
463 .oe_notebook
464 margin: 8px 0
465@@ -2764,6 +2737,44 @@
466 background-color: #7c7bad
467 // End of customize
468
469+// Customize bootstrap3 for tooltip
470+.tooltip
471+ padding: 0
472+ margin: 0
473+ font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif
474+ color: #4c4c4c
475+ font-size: 12px
476+ background: white
477+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5)
478+ background-color: transparent
479+ .tooltip-inner
480+ text-align: left !important
481+ max-width: 250px
482+ .oe_tooltip_string
483+ color: #FD5
484+ font-weight: bold
485+ font-size: 13px
486+ .oe_tooltip_help
487+ white-space: pre-wrap
488+ .oe_tooltip_technical
489+ padding: 0 0 4px 0
490+ margin: 5px 0 0 15px
491+ li
492+ list-style: circle
493+ .oe_tooltip_technical_title
494+ font-weight: bold
495+ .oe_tooltip_close
496+ margin: -5px 0 0 2px
497+ cursor: default
498+ float: right
499+ color: white
500+ &:hover
501+ color: #999
502+ cursor: pointer
503+ .oe_tooltip_message
504+ max-width: 310px
505+// End of customize
506+
507 // Customize for global tags
508 button, body
509 line-height: normal
510
511=== modified file 'addons/web/static/src/js/chrome.js'
512--- addons/web/static/src/js/chrome.js 2013-12-18 16:50:33 +0000
513+++ addons/web/static/src/js/chrome.js 2013-12-20 07:34:41 +0000
514@@ -238,6 +238,10 @@
515 if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(dialog)")) {
516 this.$el.dialog('destroy');
517 }
518+ //For Remove tooltip from dialog box when destroy
519+ //Bad fix, bootstrap mouseleave method call very late
520+ //before that this.$el and its contained removed because that tooltip sticks on page.
521+ $($.find('.tooltip.fade.in')).remove();
522 this._super();
523 }
524 });
525@@ -1261,8 +1265,8 @@
526 },
527 bind_events: function() {
528 var self = this;
529- this.$el.on('mouseenter', '.oe_systray > div:not([data-tipsy=true])', function() {
530- $(this).attr('data-tipsy', 'true').tipsy().trigger('mouseenter');
531+ this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() {
532+ $(this).attr('data-toggle', 'tooltip').tooltip({placement: 'bottom', html: true, container: 'body'}).trigger('mouseenter');
533 });
534 this.$el.on('click', '.oe_dropdown_toggle', function(ev) {
535 ev.preventDefault();
536@@ -1286,7 +1290,7 @@
537 }, 0);
538 });
539 instance.web.bus.on('click', this, function(ev) {
540- $.fn.tipsy.clear();
541+ $.fn.tooltip('destroy');
542 if (!$(ev.target).is('input[type=file]')) {
543 self.$el.find('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened');
544 }
545
546=== modified file 'addons/web/static/src/js/search.js'
547--- addons/web/static/src/js/search.js 2013-12-13 09:35:42 +0000
548+++ addons/web/static/src/js/search.js 2013-12-20 07:34:41 +0000
549@@ -400,7 +400,8 @@
550 this.query = new my.SearchQuery()
551 .on('add change reset remove', this.proxy('do_search'))
552 .on('add change reset remove', this.proxy('renderFacets'));
553-
554+ $('.oe_searchview_unfold_drawer').attr('data-toggle', 'tooltip');
555+ $('.oe_searchview_unfold_drawer').tooltip({placement: 'bottom', html: true});
556 if (this.options.hidden) {
557 this.$el.hide();
558 }
559@@ -1839,7 +1840,10 @@
560
561 return $.when(
562 this.render_column(col1, $('<div>').appendTo(this.$el)),
563- this.render_column(col2, $('<div>').appendTo(this.$el)));
564+ this.render_column(col2, $('<div>').appendTo(this.$el))).then(function () {
565+ self.$el.children().find('[title]').attr('data-toggle', 'tooltip');
566+ self.$el.children().find('[title]').tooltip({placement: 'bottom', html: true, container: 'body'});
567+ });
568 },
569 render_column: function (column, $el) {
570 return $.when.apply(null, _(column).map(function (group) {
571
572=== modified file 'addons/web/static/src/js/view_form.js'
573--- addons/web/static/src/js/view_form.js 2013-12-19 13:40:55 +0000
574+++ addons/web/static/src/js/view_form.js 2013-12-20 07:34:41 +0000
575@@ -1819,7 +1819,7 @@
576 this.$el.addClass(this.node.attrs["class"] || "");
577 },
578 destroy: function() {
579- $.fn.tipsy.clear();
580+ $.fn.tooltip('destroy');
581 this._super.apply(this, arguments);
582 },
583 /**
584@@ -1851,9 +1851,8 @@
585 widget = widget || this;
586 trigger = trigger || this.$el;
587 options = _.extend({
588- delayIn: 500,
589- delayOut: 0,
590- fade: true,
591+ delay: { show: 750, hide: 0 },
592+ trigger: 'hover',
593 title: function() {
594 var template = widget.template + '.tooltip';
595 if (!QWeb.has_template(template)) {
596@@ -1864,12 +1863,18 @@
597 widget: widget
598 });
599 },
600- gravity: $.fn.tipsy.autoBounds(50, 'nw'),
601+ container: 'body',
602+ placement: function(tip, trigger) { //dynamic set position
603+ var offset = $(trigger).offset();
604+ var vert = 0.5 * $(document).outerHeight() - offset.top;
605+ var vertPlacement = vert > 0 ? 'bottom' : 'top';
606+ return vertPlacement;
607+ },
608 html: true,
609 opacity: 0.85,
610- trigger: 'hover'
611 }, options || {});
612- $(trigger).tipsy(options);
613+ $(trigger).attr('data-toggle', 'tooltip');
614+ $(trigger).tooltip(options);
615 },
616 /**
617 * Builds a new context usable for operations related to fields by merging
618@@ -2106,8 +2111,9 @@
619 this.$el.find('.oe_field_translate').click(this.on_translate);
620 }
621 this.$label = this.view ? this.view.$el.find('label[for=' + this.id_for_label + ']') : $();
622+ if (this.field.help || instance.session.debug)
623+ this.do_attach_tooltip(this, this.$label[0] || this.$el);
624 if (instance.session.debug) {
625- this.do_attach_tooltip(this, this.$label[0] || this.$el);
626 this.$label.off('dblclick').on('dblclick', function() {
627 console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view);
628 window.w = self;
629
630=== modified file 'addons/web/static/src/js/views.js'
631--- addons/web/static/src/js/views.js 2013-12-18 16:50:33 +0000
632+++ addons/web/static/src/js/views.js 2013-12-20 07:34:41 +0000
633@@ -583,9 +583,15 @@
634 start: function() {
635 this._super();
636 var self = this;
637+ this.$el.find('.oe_view_manager_switch a').attr('data-toggle', 'tooltip');
638 this.$el.find('.oe_view_manager_switch a').click(function() {
639 self.switch_mode($(this).data('view-type'));
640- }).tipsy();
641+ $(this).tooltip('destroy');
642+ }).tooltip({
643+ container: 'body',
644+ html: true,
645+ opacity: 0.85
646+ });
647 var views_ids = {};
648 _.each(this.views_src, function(view) {
649 self.views[view.view_type] = $.extend({}, view, {
650@@ -1151,9 +1157,10 @@
651 this.$('.oe_form_dropdown_section').each(function() {
652 $(this).toggle(!!$(this).find('li').length);
653 });
654-
655- self.$("[title]").tipsy({
656+ self.$("[title]").attr('data-toggle', 'tooltip');
657+ self.$("[title]").tooltip({
658 'html': true,
659+ 'container': 'body',
660 'delayIn': 500,
661 });
662 },
663
664=== modified file 'addons/web_gantt/static/src/js/gantt.js'
665--- addons/web_gantt/static/src/js/gantt.js 2013-03-05 08:27:08 +0000
666+++ addons/web_gantt/static/src/js/gantt.js 2013-12-20 07:34:41 +0000
667@@ -202,6 +202,7 @@
668 }
669 // Fix for IE to display the content of gantt view.
670 this.$el.find(".oe_gantt td:first > div, .oe_gantt td:eq(1) > div > div").css("overflow", "");
671+ this.$el.children().find('[title]').attr('data-toggle', 'tooltip').tooltip({placement: 'bottom', container: 'body', html: true});
672 },
673 on_task_changed: function(task_obj) {
674 var self = this;
675
676=== modified file 'addons/web_kanban/static/src/js/kanban.js'
677--- addons/web_kanban/static/src/js/kanban.js 2013-12-19 13:50:54 +0000
678+++ addons/web_kanban/static/src/js/kanban.js 2013-12-20 07:34:41 +0000
679@@ -441,7 +441,7 @@
680 },
681 on_record_moved : function(record, old_group, old_index, new_group, new_index) {
682 var self = this;
683- $.fn.tipsy.clear();
684+ record.$el.children().find('[title]').tooltip('destroy');
685 $(old_group.$el).add(new_group.$el).find('.oe_kanban_aggregates, .oe_kanban_group_length').hide();
686 if (old_group === new_group) {
687 new_group.records.splice(old_index, 1);
688@@ -648,7 +648,7 @@
689 this.$records.data('widget', this);
690 this.$has_been_started.resolve();
691 var add_btn = this.$el.find('.oe_kanban_add');
692- add_btn.tipsy({delayIn: 500, delayOut: 1000});
693+ add_btn.tooltip({html: true, container: 'body', delayIn: 500, delayOut: 1000});
694 this.$records.find(".oe_kanban_column_cards").click(function (ev) {
695 if (ev.target == ev.currentTarget) {
696 if (!self.state.folded) {
697@@ -688,7 +688,7 @@
698 return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by])
699 .filter([["id", "=", this.value]]).first().then(function(res) {
700 self.tooltip = res[options.tooltip_on_group_by];
701- self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tipsy({html: true});
702+ self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tooltip({html: true, placement: 'bottom', container: 'body'});
703 });
704 }
705 },
706@@ -925,10 +925,8 @@
707 bind_events: function() {
708 var self = this;
709 this.setup_color_picker();
710- this.$el.find('[tooltip]').tipsy({
711- delayIn: 500,
712- delayOut: 0,
713- fade: true,
714+ this.$el.find('[title]').attr('data-toggle', 'tooltip');
715+ this.$el.find('[data-toggle]').tooltip({
716 title: function() {
717 var template = $(this).attr('tooltip');
718 if (!self.view.qweb.has_template(template)) {
719@@ -936,10 +934,10 @@
720 }
721 return self.view.qweb.render(template, self.qweb_context);
722 },
723- gravity: 's',
724+ placement: 'bottom',
725 html: true,
726 opacity: 0.8,
727- trigger: 'hover'
728+ container: 'body'
729 });
730
731 // If no draghandle is found, make the whole card as draghandle (provided one can edit)
732
733=== modified file 'addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js'
734--- addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js 2013-12-05 15:13:55 +0000
735+++ addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js 2013-12-20 07:34:41 +0000
736@@ -28,7 +28,7 @@
737 }
738 }, self.options);
739 self.$el.sparkline(value, sparkline_options);
740- self.$el.tipsy({'delayIn': self.options.delayIn || 0, 'html': true, 'title': function(){return title}, 'gravity': 'n'});
741+ self.$el.children().tooltip({'delayIn': self.options.delayIn || 0, 'html': true, 'title': function(){return title}, 'container': 'body', 'placement': 'bottom'});
742 }, 0);
743 },
744 });