Merge lp:~openerp-dev/openerp-web/trunk-bootstrap-tooltip-csn into lp:openerp-web

Proposed by Cedric Snauwaert (OpenERP)
Status: Merged
Merged at revision: 3983
Proposed branch: lp:~openerp-dev/openerp-web/trunk-bootstrap-tooltip-csn
Merge into: lp:openerp-web
Diff against target: 712 lines (+113/-372)
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 (+47/-35)
addons/web/static/src/css/base.sass (+39/-28)
addons/web/static/src/js/chrome.js (+3/-3)
addons/web/static/src/js/core.js (+5/-0)
addons/web/static/src/js/view_form.js (+9/-10)
addons/web/static/src/js/views.js (+3/-5)
addons/web/static/src/xml/base.xml (+1/-2)
addons/web_kanban/static/src/js/kanban.js (+5/-11)
addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-bootstrap-tooltip-csn
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Needs Information
Review via email: mp+216101@code.launchpad.net
To post a comment you must log in.
3976. By Cedric Snauwaert (OpenERP)

[FIX]few errors

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Since we're using the same options over and over (I see at least 4 calls with {placement: bottom, html: true}), maybe we should override bootstrap's defaults directly? http://jsfiddle.net/vHQr6/

Or at least split out some sort of centrally overridable default?

> record.$el.children().find('[title]').tooltip('destroy');

Is there a specific reason for the children() call?

review: Needs Information
3977. By Cedric Snauwaert (OpenERP)

[FIX]tooltip: overwrite bootstrap default for tooltip

3978. By Cedric Snauwaert (OpenERP)

[MERGE]merge with latest trunk

3979. By Cedric Snauwaert (OpenERP)

[FIX]tooltip: should not use placement auto since it is currently bugged in bootstrap
(see: https://github.com/twbs/bootstrap/issues/13268)

3980. By Cedric Snauwaert (OpenERP)

[FIX]tooltip: when not in debug mode, display tooltip in form view with bootstrat as well

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/__openerp__.py'
--- addons/web/__openerp__.py 2014-03-24 09:30:38 +0000
+++ addons/web/__openerp__.py 2014-04-17 14:05:17 +0000
@@ -35,7 +35,6 @@
35 "static/lib/jquery.ui.notify/js/jquery.notify.js",35 "static/lib/jquery.ui.notify/js/jquery.notify.js",
36 "static/lib/jquery.deferred-queue/jquery.deferred-queue.js",36 "static/lib/jquery.deferred-queue/jquery.deferred-queue.js",
37 "static/lib/jquery.scrollTo/jquery.scrollTo-min.js",37 "static/lib/jquery.scrollTo/jquery.scrollTo-min.js",
38 "static/lib/jquery.tipsy/jquery.tipsy.js",
39 "static/lib/jquery.textext/jquery.textext.js",38 "static/lib/jquery.textext/jquery.textext.js",
40 "static/lib/jquery.timeago/jquery.timeago.js",39 "static/lib/jquery.timeago/jquery.timeago.js",
41 "static/lib/bootstrap/js/bootstrap.js",40 "static/lib/bootstrap/js/bootstrap.js",
@@ -66,7 +65,6 @@
66 "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",65 "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",
67 "static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css",66 "static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css",
68 "static/lib/jquery.ui.notify/css/ui.notify.css",67 "static/lib/jquery.ui.notify/css/ui.notify.css",
69 "static/lib/jquery.tipsy/tipsy.css",
70 "static/lib/jquery.textext/jquery.textext.css",68 "static/lib/jquery.textext/jquery.textext.css",
71 "static/lib/fontawesome/css/font-awesome.css",69 "static/lib/fontawesome/css/font-awesome.css",
72 "static/lib/bootstrap/css/bootstrap.css",70 "static/lib/bootstrap/css/bootstrap.css",
7371
=== removed directory 'addons/web/static/lib/jquery.tipsy'
=== removed file 'addons/web/static/lib/jquery.tipsy/jquery.tipsy.js'
--- addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 2012-11-15 16:41:32 +0000
+++ addons/web/static/lib/jquery.tipsy/jquery.tipsy.js 1970-01-01 00:00:00 +0000
@@ -1,250 +0,0 @@
1// tipsy, facebook style tooltips for jquery
2// version 1.0.0a
3// (c) 2008-2010 jason frame [jason@onehackoranother.com]
4// released under the MIT license
5
6(function($) {
7
8 function maybeCall(thing, ctx) {
9 return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
10 };
11
12 function Tipsy(element, options) {
13 this.$element = $(element);
14 this.options = options;
15 this.enabled = true;
16 this.fixTitle();
17 };
18
19 Tipsy.prototype = {
20 show: function() {
21 $.fn.tipsy.clear();
22 if (!this.$element.parent().length) {
23 return;
24 }
25 var title = this.getTitle();
26 if (title && this.enabled) {
27 var $tip = this.tip();
28
29 $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
30 $tip[0].className = 'tipsy '; // reset classname in case of dynamic gravity
31 $tip.openerpClass('oe_tooltip');
32 $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
33
34 var pos = $.extend({}, this.$element.offset(), {
35 width: this.$element[0].offsetWidth,
36 height: this.$element[0].offsetHeight
37 });
38
39 var actualWidth = $tip[0].offsetWidth,
40 actualHeight = $tip[0].offsetHeight,
41 gravity = maybeCall(this.options.gravity, this.$element[0]);
42
43 var tp;
44 switch (gravity.charAt(0)) {
45 case 'n':
46 tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
47 break;
48 case 's':
49 tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
50 break;
51 case 'e':
52 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
53 break;
54 case 'w':
55 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
56 break;
57 }
58
59 if (gravity.length == 2) {
60 if (gravity.charAt(1) == 'w') {
61 tp.left = pos.left + pos.width / 2 - 15;
62 } else {
63 tp.left = pos.left + pos.width / 2 - actualWidth + 15;
64 }
65 }
66
67 $tip.css(tp).addClass('tipsy-' + gravity);
68 $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
69 if (this.options.className) {
70 $tip.addClass(maybeCall(this.options.className, this.$element[0]));
71 }
72
73 if (this.options.fade) {
74 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
75 } else {
76 $tip.css({visibility: 'visible', opacity: this.options.opacity});
77 }
78 }
79 },
80
81 hide: function() {
82 if (this.options.fade) {
83 this.tip().stop().fadeOut(function() { $(this).remove(); });
84 } else {
85 this.tip().remove();
86 }
87 },
88
89 fixTitle: function() {
90 var $e = this.$element;
91 if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
92 $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
93 }
94 },
95
96 getTitle: function() {
97 var title, $e = this.$element, o = this.options;
98 this.fixTitle();
99 var title, o = this.options;
100 if (typeof o.title == 'string') {
101 title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
102 } else if (typeof o.title == 'function') {
103 title = o.title.call($e[0]);
104 }
105 title = ('' + title).replace(/(^\s*|\s*$)/, "");
106 return title || o.fallback;
107 },
108
109 tip: function() {
110 if (!this.$tip) {
111 this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
112 }
113 return this.$tip;
114 },
115
116 validate: function() {
117 if (!this.$element[0].parentNode) {
118 this.hide();
119 this.$element = null;
120 this.options = null;
121 }
122 },
123
124 enable: function() { this.enabled = true; },
125 disable: function() { this.enabled = false; },
126 toggleEnabled: function() { this.enabled = !this.enabled; }
127 };
128
129 $.fn.tipsy = function(options) {
130
131 if (options === true) {
132 return this.data('tipsy');
133 } else if (typeof options == 'string') {
134 var tipsy = this.data('tipsy');
135 if (tipsy) tipsy[options]();
136 return this;
137 }
138
139 options = $.extend({}, $.fn.tipsy.defaults, options);
140
141 function get(ele) {
142 var tipsy = $.data(ele, 'tipsy');
143 if (!tipsy) {
144 tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
145 $.data(ele, 'tipsy', tipsy);
146 }
147 return tipsy;
148 }
149
150 function enter() {
151 var tipsy = get(this);
152 tipsy.hoverState = 'in';
153 if (options.delayIn == 0) {
154 tipsy.show();
155 } else {
156 tipsy.fixTitle();
157 setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
158 }
159 };
160
161 function leave() {
162 var tipsy = get(this);
163 tipsy.hoverState = 'out';
164 if (options.delayOut == 0) {
165 tipsy.hide();
166 } else {
167 setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
168 }
169 };
170
171 if (!options.live) this.each(function() { get(this); });
172
173 if (options.trigger != 'manual') {
174 var binder = options.live ? 'live' : 'bind',
175 eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
176 eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
177 this[binder](eventIn, enter)[binder](eventOut, leave);
178 }
179
180 return this;
181
182 };
183
184 $.fn.tipsy.clear = function() {
185 $('div.tipsy').stop().remove();
186 }
187
188 $.fn.tipsy.defaults = {
189 className: null,
190 delayIn: 0,
191 delayOut: 0,
192 fade: false,
193 fallback: '',
194 gravity: 'n',
195 html: false,
196 live: false,
197 offset: 0,
198 opacity: 0.8,
199 title: 'title',
200 trigger: 'hover'
201 };
202
203 // Overwrite this method to provide options on a per-element basis.
204 // For example, you could store the gravity in a 'tipsy-gravity' attribute:
205 // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
206 // (remember - do not modify 'options' in place!)
207 $.fn.tipsy.elementOptions = function(ele, options) {
208 return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
209 };
210
211 $.fn.tipsy.autoNS = function() {
212 return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
213 };
214
215 $.fn.tipsy.autoWE = function() {
216 return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
217 };
218
219 /**
220 * yields a closure of the supplied parameters, producing a function that takes
221 * no arguments and is suitable for use as an autogravity function like so:
222 *
223 * @param margin (int) - distance from the viewable region edge that an
224 * element should be before setting its tooltip's gravity to be away
225 * from that edge.
226 * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
227 * if there are no viewable region edges effecting the tooltip's
228 * gravity. It will try to vary from this minimally, for example,
229 * if 'sw' is preferred and an element is near the right viewable
230 * region edge, but not the top edge, it will set the gravity for
231 * that element's tooltip to be 'se', preserving the southern
232 * component.
233 */
234 $.fn.tipsy.autoBounds = function(margin, prefer) {
235 return function() {
236 var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
237 boundTop = $(document).scrollTop() + margin,
238 boundLeft = $(document).scrollLeft() + margin,
239 $this = $(this);
240
241 if ($this.offset().top < boundTop) dir.ns = 'n';
242 if ($this.offset().left < boundLeft) dir.ew = 'w';
243 if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
244 if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
245
246 return dir.ns + (dir.ew ? dir.ew : '');
247 }
248 };
249
250})(jQuery);
2510
=== removed file 'addons/web/static/lib/jquery.tipsy/tipsy.css'
--- addons/web/static/lib/jquery.tipsy/tipsy.css 2012-09-21 14:09:32 +0000
+++ addons/web/static/lib/jquery.tipsy/tipsy.css 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
1.tipsy { font-size: 90%; position: absolute; padding: 5px; z-index: 100000; overflow: hidden;}
2 .tipsy-inner { background-color: #000; color: #FFF; max-width: 500px; padding: 5px 8px 4px 8px; }
3
4 /* Rounded corners */
5 .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
6
7 /* Uncomment for shadow */
8 .tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }
9
10 .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
11
12 /* Rules to colour arrows */
13 .tipsy-arrow-n { border-bottom-color: #000; }
14 .tipsy-arrow-s { border-top-color: #000; }
15 .tipsy-arrow-e { border-left-color: #000; }
16 .tipsy-arrow-w { border-right-color: #000; }
17
18 .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; }
19 .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
20 .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
21 .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; }
22 .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
23 .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
24 .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; }
25 .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; }
260
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css 2014-04-17 09:10:32 +0000
+++ addons/web/static/src/css/base.css 2014-04-17 14:05:17 +0000
@@ -504,40 +504,6 @@
504 font-style: italic;504 font-style: italic;
505 text-decoration: none;505 text-decoration: none;
506}506}
507.openerp.oe_tooltip {
508 font-size: 12px;
509}
510.openerp.oe_tooltip .oe_tooltip_string {
511 color: #ffdd55;
512 font-weight: bold;
513 font-size: 13px;
514}
515.openerp.oe_tooltip .oe_tooltip_help {
516 white-space: pre-wrap;
517}
518.openerp.oe_tooltip .oe_tooltip_technical {
519 padding: 0 0 4px 0;
520 margin: 5px 0 0 15px;
521}
522.openerp.oe_tooltip .oe_tooltip_technical li {
523 list-style: circle;
524}
525.openerp.oe_tooltip .oe_tooltip_technical_title {
526 font-weight: bold;
527}
528.openerp.oe_tooltip .oe_tooltip_close {
529 margin: -5px 0 0 2px;
530 cursor: default;
531 float: right;
532 color: white;
533}
534.openerp.oe_tooltip .oe_tooltip_close:hover {
535 color: #999999;
536 cursor: pointer;
537}
538.openerp.oe_tooltip .oe_tooltip_message {
539 max-width: 310px;
540}
541.openerp .oe_notebook {507.openerp .oe_notebook {
542 margin: 8px 0;508 margin: 8px 0;
543 padding: 0 16px;509 padding: 0 16px;
@@ -1924,7 +1890,7 @@
1924.openerp .oe_form > :not(.oe_form_nosheet) header {1890.openerp .oe_form > :not(.oe_form_nosheet) header {
1925 padding-left: 2px;1891 padding-left: 2px;
1926}1892}
1927.openerp .oe_form > :not(.oe_form_nosheet) header ul {1893.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical) {
1928 display: inline-block;1894 display: inline-block;
1929 float: right;1895 float: right;
1930}1896}
@@ -3331,6 +3297,52 @@
3331 width: 18px;3297 width: 18px;
3332 height: 18px;3298 height: 18px;
3333}3299}
3300
3301.tooltip {
3302 padding: 0;
3303 margin: 0;
3304 font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
3305 color: #4c4c4c;
3306 font-size: 12px;
3307 background: white;
3308 text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
3309 background-color: transparent;
3310}
3311.tooltip .tooltip-inner {
3312 text-align: left !important;
3313 max-width: 350px;
3314}
3315.tooltip .tooltip-inner .oe_tooltip_string {
3316 color: #ffdd55;
3317 font-weight: bold;
3318 font-size: 13px;
3319}
3320.tooltip .tooltip-inner .oe_tooltip_help {
3321 white-space: pre-wrap;
3322}
3323.tooltip .tooltip-inner .oe_tooltip_technical {
3324 padding: 0 0 4px 0;
3325 margin: 5px 0 0 15px;
3326}
3327.tooltip .tooltip-inner .oe_tooltip_technical li {
3328 list-style: circle;
3329}
3330.tooltip .tooltip-inner .oe_tooltip_technical_title {
3331 font-weight: bold;
3332}
3333.tooltip .tooltip-inner .oe_tooltip_close {
3334 margin: -5px 0 0 2px;
3335 cursor: default;
3336 float: right;
3337 color: white;
3338}
3339.tooltip .tooltip-inner .oe_tooltip_close:hover {
3340 color: #999999;
3341 cursor: pointer;
3342}
3343.tooltip .tooltip-inner .oe_tooltip_message {
3344 max-width: 310px;
3345}
3334.modal .modal-header button.close {3346.modal .modal-header button.close {
3335 border: none;3347 border: none;
3336 background: none;3348 background: none;
33373349
=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass 2014-04-17 09:10:32 +0000
+++ addons/web/static/src/css/base.sass 2014-04-17 14:05:17 +0000
@@ -472,33 +472,6 @@
472 text-decoration: none472 text-decoration: none
473 margin-bottom: 1px473 margin-bottom: 1px
474 // }}}474 // }}}
475 // Tooltips {{{
476 &.oe_tooltip
477 font-size: 12px
478 .oe_tooltip_string
479 color: #FD5
480 font-weight: bold
481 font-size: 13px
482 .oe_tooltip_help
483 white-space: pre-wrap
484 .oe_tooltip_technical
485 padding: 0 0 4px 0
486 margin: 5px 0 0 15px
487 li
488 list-style: circle
489 .oe_tooltip_technical_title
490 font-weight: bold
491 .oe_tooltip_close
492 margin: -5px 0 0 2px
493 cursor: default
494 float: right
495 color: white
496 &:hover
497 color: #999
498 cursor: pointer
499 .oe_tooltip_message
500 max-width: 310px
501 // }}}
502 // Notebook {{{475 // Notebook {{{
503 .oe_notebook476 .oe_notebook
504 margin: 8px 0477 margin: 8px 0
@@ -1577,7 +1550,7 @@
1577 // FormView.header {{{1550 // FormView.header {{{
1578 .oe_form > :not(.oe_form_nosheet) header1551 .oe_form > :not(.oe_form_nosheet) header
1579 padding-left: 2px1552 padding-left: 2px
1580 ul1553 ul:not(.oe_tooltip_technical)
1581 display: inline-block1554 display: inline-block
1582 float: right1555 float: right
1583 .oe_button1556 .oe_button
@@ -2703,6 +2676,44 @@
2703 overflow: hidden !important2676 overflow: hidden !important
2704// }}}2677// }}}
27052678
2679// End of customize
2680
2681// Customize bootstrap3 for tooltip
2682.tooltip
2683 padding: 0
2684 margin: 0
2685 font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif
2686 color: #4c4c4c
2687 font-size: 12px
2688 background: white
2689 text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5)
2690 background-color: transparent
2691 .tooltip-inner
2692 text-align: left !important
2693 max-width: 350px
2694 .oe_tooltip_string
2695 color: #FD5
2696 font-weight: bold
2697 font-size: 13px
2698 .oe_tooltip_help
2699 white-space: pre-wrap
2700 .oe_tooltip_technical
2701 padding: 0 0 4px 0
2702 margin: 5px 0 0 15px
2703 li
2704 list-style: circle
2705 .oe_tooltip_technical_title
2706 font-weight: bold
2707 .oe_tooltip_close
2708 margin: -5px 0 0 2px
2709 cursor: default
2710 float: right
2711 color: white
2712 &:hover
2713 color: #999
2714 cursor: pointer
2715 .oe_tooltip_message
2716 max-width: 310px
27062717
2707// Hack for ui icon {{{2718// Hack for ui icon {{{
2708.ui-icon2719.ui-icon
27092720
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2014-04-16 12:00:34 +0000
+++ addons/web/static/src/js/chrome.js 2014-04-17 14:05:17 +0000
@@ -1078,8 +1078,8 @@
1078 },1078 },
1079 bind_events: function() {1079 bind_events: function() {
1080 var self = this;1080 var self = this;
1081 this.$el.on('mouseenter', '.oe_systray > div:not([data-tipsy=true])', function() {1081 this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() {
1082 $(this).attr('data-tipsy', 'true').tipsy().trigger('mouseenter');1082 $(this).attr('data-toggle', 'tooltip').tooltip().trigger('mouseenter');
1083 });1083 });
1084 this.$el.on('click', '.oe_dropdown_toggle', function(ev) {1084 this.$el.on('click', '.oe_dropdown_toggle', function(ev) {
1085 ev.preventDefault();1085 ev.preventDefault();
@@ -1103,7 +1103,7 @@
1103 }, 0);1103 }, 0);
1104 });1104 });
1105 instance.web.bus.on('click', this, function(ev) {1105 instance.web.bus.on('click', this, function(ev) {
1106 $.fn.tipsy.clear();1106 $.fn.tooltip('destroy');
1107 if (!$(ev.target).is('input[type=file]')) {1107 if (!$(ev.target).is('input[type=file]')) {
1108 self.$el.find('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened');1108 self.$el.find('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened');
1109 }1109 }
11101110
=== modified file 'addons/web/static/src/js/core.js'
--- addons/web/static/src/js/core.js 2014-04-02 09:23:10 +0000
+++ addons/web/static/src/js/core.js 2014-04-17 14:05:17 +0000
@@ -788,6 +788,11 @@
788 return $.unblockUI.apply($, arguments);788 return $.unblockUI.apply($, arguments);
789};789};
790790
791
792/* Bootstrap defaults overwrite */
793$.fn.tooltip.Constructor.DEFAULTS.placement = 'bottom';
794$.fn.tooltip.Constructor.DEFAULTS.html = true;
795
791/**796/**
792 * Registry for all the client actions key: tag value: widget797 * Registry for all the client actions key: tag value: widget
793 */798 */
794799
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2014-04-16 15:15:43 +0000
+++ addons/web/static/src/js/view_form.js 2014-04-17 14:05:17 +0000
@@ -1835,7 +1835,7 @@
1835 this.$el.addClass(this.node.attrs["class"] || "");1835 this.$el.addClass(this.node.attrs["class"] || "");
1836 },1836 },
1837 destroy: function() {1837 destroy: function() {
1838 $.fn.tipsy.clear();1838 $.fn.tooltip('destroy');
1839 this._super.apply(this, arguments);1839 this._super.apply(this, arguments);
1840 },1840 },
1841 /**1841 /**
@@ -1867,9 +1867,8 @@
1867 widget = widget || this;1867 widget = widget || this;
1868 trigger = trigger || this.$el;1868 trigger = trigger || this.$el;
1869 options = _.extend({1869 options = _.extend({
1870 delayIn: 500,1870 delay: { show: 500, hide: 0 },
1871 delayOut: 0,1871 trigger: 'hover',
1872 fade: true,
1873 title: function() {1872 title: function() {
1874 var template = widget.template + '.tooltip';1873 var template = widget.template + '.tooltip';
1875 if (!QWeb.has_template(template)) {1874 if (!QWeb.has_template(template)) {
@@ -1880,12 +1879,12 @@
1880 widget: widget1879 widget: widget
1881 });1880 });
1882 },1881 },
1883 gravity: $.fn.tipsy.autoBounds(50, 'nw'),
1884 html: true,
1885 opacity: 0.85,
1886 trigger: 'hover'
1887 }, options || {});1882 }, options || {});
1888 $(trigger).tipsy(options);1883 //only show tooltip if we are in debug or if we have a help to show, otherwise it will display
1884 //as empty
1885 if (instance.session.debug || widget.node.attrs.help || (widget.field && widget.field.help)){
1886 $(trigger).tooltip(options);
1887 }
1889 },1888 },
1890 /**1889 /**
1891 * Builds a new context usable for operations related to fields by merging1890 * Builds a new context usable for operations related to fields by merging
@@ -2122,8 +2121,8 @@
2122 this.$el.find('.oe_field_translate').click(this.on_translate);2121 this.$el.find('.oe_field_translate').click(this.on_translate);
2123 }2122 }
2124 this.$label = this.view ? this.view.$el.find('label[for=' + this.id_for_label + ']') : $();2123 this.$label = this.view ? this.view.$el.find('label[for=' + this.id_for_label + ']') : $();
2124 this.do_attach_tooltip(this, this.$label[0] || this.$el);
2125 if (instance.session.debug) {2125 if (instance.session.debug) {
2126 this.do_attach_tooltip(this, this.$label[0] || this.$el);
2127 this.$label.off('dblclick').on('dblclick', function() {2126 this.$label.off('dblclick').on('dblclick', function() {
2128 console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view);2127 console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view);
2129 window.w = self;2128 window.w = self;
21302129
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js 2014-04-15 13:25:28 +0000
+++ addons/web/static/src/js/views.js 2014-04-17 14:05:17 +0000
@@ -581,7 +581,7 @@
581 var self = this;581 var self = this;
582 this.$el.find('.oe_view_manager_switch a').click(function() {582 this.$el.find('.oe_view_manager_switch a').click(function() {
583 self.switch_mode($(this).data('view-type'));583 self.switch_mode($(this).data('view-type'));
584 }).tipsy();584 }).tooltip();
585 var views_ids = {};585 var views_ids = {};
586 _.each(this.views_src, function(view) {586 _.each(this.views_src, function(view) {
587 self.views[view.view_type] = $.extend({}, view, {587 self.views[view.view_type] = $.extend({}, view, {
@@ -1157,10 +1157,8 @@
1157 this.$('.oe_form_dropdown_section').each(function() {1157 this.$('.oe_form_dropdown_section').each(function() {
1158 $(this).toggle(!!$(this).find('li').length);1158 $(this).toggle(!!$(this).find('li').length);
1159 });1159 });
11601160 self.$("[title]").tooltip({
1161 self.$("[title]").tipsy({1161 delay: { show: 500, hide: 0}
1162 'html': true,
1163 'delayIn': 500,
1164 });1162 });
1165 },1163 },
1166 /**1164 /**
11671165
=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml 2014-04-15 13:39:14 +0000
+++ addons/web/static/src/xml/base.xml 2014-04-17 14:05:17 +0000
@@ -943,7 +943,6 @@
943</t>943</t>
944<t t-name="FormRenderingLabel">944<t t-name="FormRenderingLabel">
945 <label t-att-for="_for"945 <label t-att-for="_for"
946 t-att-title="help"
947 t-attf-class="#{classnames} oe_form_label#{help ? '_help' : ''} oe_align_#{align}">946 t-attf-class="#{classnames} oe_form_label#{help ? '_help' : ''} oe_align_#{align}">
948 <t t-esc="string"/>947 <t t-esc="string"/>
949 </label>948 </label>
@@ -1005,7 +1004,7 @@
1005 </li>1004 </li>
1006 <li t-if="widget.field and widget.field.selection" data-item="selection">1005 <li t-if="widget.field and widget.field.selection" data-item="selection">
1007 <span class="oe_tooltip_technical_title">Selection:</span>1006 <span class="oe_tooltip_technical_title">Selection:</span>
1008 <ul>1007 <ul class="oe_tooltip_technical">
1009 <li t-foreach="widget.field.selection" t-as="option">1008 <li t-foreach="widget.field.selection" t-as="option">
1010 [<t t-esc="option[0]"/>]1009 [<t t-esc="option[0]"/>]
1011 <t t-if="option[1]"> - </t>1010 <t t-if="option[1]"> - </t>
10121011
=== modified file 'addons/web_kanban/static/src/js/kanban.js'
--- addons/web_kanban/static/src/js/kanban.js 2014-03-05 11:33:07 +0000
+++ addons/web_kanban/static/src/js/kanban.js 2014-04-17 14:05:17 +0000
@@ -441,7 +441,7 @@
441 },441 },
442 on_record_moved : function(record, old_group, old_index, new_group, new_index) {442 on_record_moved : function(record, old_group, old_index, new_group, new_index) {
443 var self = this;443 var self = this;
444 $.fn.tipsy.clear();444 record.$el.find('[title]').tooltip('destroy');
445 $(old_group.$el).add(new_group.$el).find('.oe_kanban_aggregates, .oe_kanban_group_length').hide();445 $(old_group.$el).add(new_group.$el).find('.oe_kanban_aggregates, .oe_kanban_group_length').hide();
446 if (old_group === new_group) {446 if (old_group === new_group) {
447 new_group.records.splice(old_index, 1);447 new_group.records.splice(old_index, 1);
@@ -648,7 +648,7 @@
648 this.$records.data('widget', this);648 this.$records.data('widget', this);
649 this.$has_been_started.resolve();649 this.$has_been_started.resolve();
650 var add_btn = this.$el.find('.oe_kanban_add');650 var add_btn = this.$el.find('.oe_kanban_add');
651 add_btn.tipsy({delayIn: 500, delayOut: 1000});651 add_btn.tooltip({delay: { show: 500, hide:1000 }});
652 this.$records.find(".oe_kanban_column_cards").click(function (ev) {652 this.$records.find(".oe_kanban_column_cards").click(function (ev) {
653 if (ev.target == ev.currentTarget) {653 if (ev.target == ev.currentTarget) {
654 if (!self.state.folded) {654 if (!self.state.folded) {
@@ -688,7 +688,7 @@
688 return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by])688 return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by])
689 .filter([["id", "=", this.value]]).first().then(function(res) {689 .filter([["id", "=", this.value]]).first().then(function(res) {
690 self.tooltip = res[options.tooltip_on_group_by];690 self.tooltip = res[options.tooltip_on_group_by];
691 self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tipsy({html: true});691 self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tooltip();
692 });692 });
693 }693 }
694 },694 },
@@ -925,10 +925,8 @@
925 bind_events: function() {925 bind_events: function() {
926 var self = this;926 var self = this;
927 this.setup_color_picker();927 this.setup_color_picker();
928 this.$el.find('[tooltip]').tipsy({928 this.$el.find('[title]').tooltip({
929 delayIn: 500,929 delay: { show: 500, hide: 0},
930 delayOut: 0,
931 fade: true,
932 title: function() {930 title: function() {
933 var template = $(this).attr('tooltip');931 var template = $(this).attr('tooltip');
934 if (!self.view.qweb.has_template(template)) {932 if (!self.view.qweb.has_template(template)) {
@@ -936,10 +934,6 @@
936 }934 }
937 return self.view.qweb.render(template, self.qweb_context);935 return self.view.qweb.render(template, self.qweb_context);
938 },936 },
939 gravity: 's',
940 html: true,
941 opacity: 0.8,
942 trigger: 'hover'
943 });937 });
944938
945 // If no draghandle is found, make the whole card as draghandle (provided one can edit)939 // If no draghandle is found, make the whole card as draghandle (provided one can edit)
946940
=== modified file 'addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js'
--- addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js 2014-01-06 13:16:05 +0000
+++ addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js 2014-04-17 14:05:17 +0000
@@ -29,7 +29,7 @@
29 }29 }
30 }, self.options);30 }, self.options);
31 self.$el.sparkline(value, sparkline_options);31 self.$el.sparkline(value, sparkline_options);
32 self.$el.tipsy({'delayIn': self.options.delayIn || 0, 'html': true, 'title': function(){return title}, 'gravity': 'n'});32 self.$el.tooltip({delay: {show: self.options.delayIn || 0, hide: 0}, title: function(){return title}});
33 }, 0);33 }, 0);
34 },34 },
35});35});