Merge lp:~openerp-dev/openerp-web/trunk-bootstrap-tooltip-csn into lp:openerp-web
- trunk-bootstrap-tooltip-csn
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xavier (Open ERP) (community) | Needs Information | ||
Review via email: mp+216101@code.launchpad.net |
Commit message
Description of the change
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 : | # |
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
1 | === modified file 'addons/web/__openerp__.py' |
2 | --- addons/web/__openerp__.py 2014-03-24 09:30:38 +0000 |
3 | +++ addons/web/__openerp__.py 2014-04-17 14:05:17 +0000 |
4 | @@ -35,7 +35,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 | @@ -66,7 +65,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 2014-04-17 09:10:32 +0000 |
309 | +++ addons/web/static/src/css/base.css 2014-04-17 14:05:17 +0000 |
310 | @@ -504,40 +504,6 @@ |
311 | font-style: italic; |
312 | text-decoration: none; |
313 | } |
314 | -.openerp.oe_tooltip { |
315 | - font-size: 12px; |
316 | -} |
317 | -.openerp.oe_tooltip .oe_tooltip_string { |
318 | - color: #ffdd55; |
319 | - font-weight: bold; |
320 | - font-size: 13px; |
321 | -} |
322 | -.openerp.oe_tooltip .oe_tooltip_help { |
323 | - white-space: pre-wrap; |
324 | -} |
325 | -.openerp.oe_tooltip .oe_tooltip_technical { |
326 | - padding: 0 0 4px 0; |
327 | - margin: 5px 0 0 15px; |
328 | -} |
329 | -.openerp.oe_tooltip .oe_tooltip_technical li { |
330 | - list-style: circle; |
331 | -} |
332 | -.openerp.oe_tooltip .oe_tooltip_technical_title { |
333 | - font-weight: bold; |
334 | -} |
335 | -.openerp.oe_tooltip .oe_tooltip_close { |
336 | - margin: -5px 0 0 2px; |
337 | - cursor: default; |
338 | - float: right; |
339 | - color: white; |
340 | -} |
341 | -.openerp.oe_tooltip .oe_tooltip_close:hover { |
342 | - color: #999999; |
343 | - cursor: pointer; |
344 | -} |
345 | -.openerp.oe_tooltip .oe_tooltip_message { |
346 | - max-width: 310px; |
347 | -} |
348 | .openerp .oe_notebook { |
349 | margin: 8px 0; |
350 | padding: 0 16px; |
351 | @@ -1924,7 +1890,7 @@ |
352 | .openerp .oe_form > :not(.oe_form_nosheet) header { |
353 | padding-left: 2px; |
354 | } |
355 | -.openerp .oe_form > :not(.oe_form_nosheet) header ul { |
356 | +.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical) { |
357 | display: inline-block; |
358 | float: right; |
359 | } |
360 | @@ -3331,6 +3297,52 @@ |
361 | width: 18px; |
362 | height: 18px; |
363 | } |
364 | + |
365 | +.tooltip { |
366 | + padding: 0; |
367 | + margin: 0; |
368 | + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; |
369 | + color: #4c4c4c; |
370 | + font-size: 12px; |
371 | + background: white; |
372 | + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); |
373 | + background-color: transparent; |
374 | +} |
375 | +.tooltip .tooltip-inner { |
376 | + text-align: left !important; |
377 | + max-width: 350px; |
378 | +} |
379 | +.tooltip .tooltip-inner .oe_tooltip_string { |
380 | + color: #ffdd55; |
381 | + font-weight: bold; |
382 | + font-size: 13px; |
383 | +} |
384 | +.tooltip .tooltip-inner .oe_tooltip_help { |
385 | + white-space: pre-wrap; |
386 | +} |
387 | +.tooltip .tooltip-inner .oe_tooltip_technical { |
388 | + padding: 0 0 4px 0; |
389 | + margin: 5px 0 0 15px; |
390 | +} |
391 | +.tooltip .tooltip-inner .oe_tooltip_technical li { |
392 | + list-style: circle; |
393 | +} |
394 | +.tooltip .tooltip-inner .oe_tooltip_technical_title { |
395 | + font-weight: bold; |
396 | +} |
397 | +.tooltip .tooltip-inner .oe_tooltip_close { |
398 | + margin: -5px 0 0 2px; |
399 | + cursor: default; |
400 | + float: right; |
401 | + color: white; |
402 | +} |
403 | +.tooltip .tooltip-inner .oe_tooltip_close:hover { |
404 | + color: #999999; |
405 | + cursor: pointer; |
406 | +} |
407 | +.tooltip .tooltip-inner .oe_tooltip_message { |
408 | + max-width: 310px; |
409 | +} |
410 | .modal .modal-header button.close { |
411 | border: none; |
412 | background: none; |
413 | |
414 | === modified file 'addons/web/static/src/css/base.sass' |
415 | --- addons/web/static/src/css/base.sass 2014-04-17 09:10:32 +0000 |
416 | +++ addons/web/static/src/css/base.sass 2014-04-17 14:05:17 +0000 |
417 | @@ -472,33 +472,6 @@ |
418 | text-decoration: none |
419 | margin-bottom: 1px |
420 | // }}} |
421 | - // Tooltips {{{ |
422 | - &.oe_tooltip |
423 | - font-size: 12px |
424 | - .oe_tooltip_string |
425 | - color: #FD5 |
426 | - font-weight: bold |
427 | - font-size: 13px |
428 | - .oe_tooltip_help |
429 | - white-space: pre-wrap |
430 | - .oe_tooltip_technical |
431 | - padding: 0 0 4px 0 |
432 | - margin: 5px 0 0 15px |
433 | - li |
434 | - list-style: circle |
435 | - .oe_tooltip_technical_title |
436 | - font-weight: bold |
437 | - .oe_tooltip_close |
438 | - margin: -5px 0 0 2px |
439 | - cursor: default |
440 | - float: right |
441 | - color: white |
442 | - &:hover |
443 | - color: #999 |
444 | - cursor: pointer |
445 | - .oe_tooltip_message |
446 | - max-width: 310px |
447 | - // }}} |
448 | // Notebook {{{ |
449 | .oe_notebook |
450 | margin: 8px 0 |
451 | @@ -1577,7 +1550,7 @@ |
452 | // FormView.header {{{ |
453 | .oe_form > :not(.oe_form_nosheet) header |
454 | padding-left: 2px |
455 | - ul |
456 | + ul:not(.oe_tooltip_technical) |
457 | display: inline-block |
458 | float: right |
459 | .oe_button |
460 | @@ -2703,6 +2676,44 @@ |
461 | overflow: hidden !important |
462 | // }}} |
463 | |
464 | +// End of customize |
465 | + |
466 | +// Customize bootstrap3 for tooltip |
467 | +.tooltip |
468 | + padding: 0 |
469 | + margin: 0 |
470 | + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif |
471 | + color: #4c4c4c |
472 | + font-size: 12px |
473 | + background: white |
474 | + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) |
475 | + background-color: transparent |
476 | + .tooltip-inner |
477 | + text-align: left !important |
478 | + max-width: 350px |
479 | + .oe_tooltip_string |
480 | + color: #FD5 |
481 | + font-weight: bold |
482 | + font-size: 13px |
483 | + .oe_tooltip_help |
484 | + white-space: pre-wrap |
485 | + .oe_tooltip_technical |
486 | + padding: 0 0 4px 0 |
487 | + margin: 5px 0 0 15px |
488 | + li |
489 | + list-style: circle |
490 | + .oe_tooltip_technical_title |
491 | + font-weight: bold |
492 | + .oe_tooltip_close |
493 | + margin: -5px 0 0 2px |
494 | + cursor: default |
495 | + float: right |
496 | + color: white |
497 | + &:hover |
498 | + color: #999 |
499 | + cursor: pointer |
500 | + .oe_tooltip_message |
501 | + max-width: 310px |
502 | |
503 | // Hack for ui icon {{{ |
504 | .ui-icon |
505 | |
506 | === modified file 'addons/web/static/src/js/chrome.js' |
507 | --- addons/web/static/src/js/chrome.js 2014-04-16 12:00:34 +0000 |
508 | +++ addons/web/static/src/js/chrome.js 2014-04-17 14:05:17 +0000 |
509 | @@ -1078,8 +1078,8 @@ |
510 | }, |
511 | bind_events: function() { |
512 | var self = this; |
513 | - this.$el.on('mouseenter', '.oe_systray > div:not([data-tipsy=true])', function() { |
514 | - $(this).attr('data-tipsy', 'true').tipsy().trigger('mouseenter'); |
515 | + this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() { |
516 | + $(this).attr('data-toggle', 'tooltip').tooltip().trigger('mouseenter'); |
517 | }); |
518 | this.$el.on('click', '.oe_dropdown_toggle', function(ev) { |
519 | ev.preventDefault(); |
520 | @@ -1103,7 +1103,7 @@ |
521 | }, 0); |
522 | }); |
523 | instance.web.bus.on('click', this, function(ev) { |
524 | - $.fn.tipsy.clear(); |
525 | + $.fn.tooltip('destroy'); |
526 | if (!$(ev.target).is('input[type=file]')) { |
527 | self.$el.find('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened'); |
528 | } |
529 | |
530 | === modified file 'addons/web/static/src/js/core.js' |
531 | --- addons/web/static/src/js/core.js 2014-04-02 09:23:10 +0000 |
532 | +++ addons/web/static/src/js/core.js 2014-04-17 14:05:17 +0000 |
533 | @@ -788,6 +788,11 @@ |
534 | return $.unblockUI.apply($, arguments); |
535 | }; |
536 | |
537 | + |
538 | +/* Bootstrap defaults overwrite */ |
539 | +$.fn.tooltip.Constructor.DEFAULTS.placement = 'bottom'; |
540 | +$.fn.tooltip.Constructor.DEFAULTS.html = true; |
541 | + |
542 | /** |
543 | * Registry for all the client actions key: tag value: widget |
544 | */ |
545 | |
546 | === modified file 'addons/web/static/src/js/view_form.js' |
547 | --- addons/web/static/src/js/view_form.js 2014-04-16 15:15:43 +0000 |
548 | +++ addons/web/static/src/js/view_form.js 2014-04-17 14:05:17 +0000 |
549 | @@ -1835,7 +1835,7 @@ |
550 | this.$el.addClass(this.node.attrs["class"] || ""); |
551 | }, |
552 | destroy: function() { |
553 | - $.fn.tipsy.clear(); |
554 | + $.fn.tooltip('destroy'); |
555 | this._super.apply(this, arguments); |
556 | }, |
557 | /** |
558 | @@ -1867,9 +1867,8 @@ |
559 | widget = widget || this; |
560 | trigger = trigger || this.$el; |
561 | options = _.extend({ |
562 | - delayIn: 500, |
563 | - delayOut: 0, |
564 | - fade: true, |
565 | + delay: { show: 500, hide: 0 }, |
566 | + trigger: 'hover', |
567 | title: function() { |
568 | var template = widget.template + '.tooltip'; |
569 | if (!QWeb.has_template(template)) { |
570 | @@ -1880,12 +1879,12 @@ |
571 | widget: widget |
572 | }); |
573 | }, |
574 | - gravity: $.fn.tipsy.autoBounds(50, 'nw'), |
575 | - html: true, |
576 | - opacity: 0.85, |
577 | - trigger: 'hover' |
578 | }, options || {}); |
579 | - $(trigger).tipsy(options); |
580 | + //only show tooltip if we are in debug or if we have a help to show, otherwise it will display |
581 | + //as empty |
582 | + if (instance.session.debug || widget.node.attrs.help || (widget.field && widget.field.help)){ |
583 | + $(trigger).tooltip(options); |
584 | + } |
585 | }, |
586 | /** |
587 | * Builds a new context usable for operations related to fields by merging |
588 | @@ -2122,8 +2121,8 @@ |
589 | this.$el.find('.oe_field_translate').click(this.on_translate); |
590 | } |
591 | this.$label = this.view ? this.view.$el.find('label[for=' + this.id_for_label + ']') : $(); |
592 | + this.do_attach_tooltip(this, this.$label[0] || this.$el); |
593 | if (instance.session.debug) { |
594 | - this.do_attach_tooltip(this, this.$label[0] || this.$el); |
595 | this.$label.off('dblclick').on('dblclick', function() { |
596 | console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view); |
597 | window.w = self; |
598 | |
599 | === modified file 'addons/web/static/src/js/views.js' |
600 | --- addons/web/static/src/js/views.js 2014-04-15 13:25:28 +0000 |
601 | +++ addons/web/static/src/js/views.js 2014-04-17 14:05:17 +0000 |
602 | @@ -581,7 +581,7 @@ |
603 | var self = this; |
604 | this.$el.find('.oe_view_manager_switch a').click(function() { |
605 | self.switch_mode($(this).data('view-type')); |
606 | - }).tipsy(); |
607 | + }).tooltip(); |
608 | var views_ids = {}; |
609 | _.each(this.views_src, function(view) { |
610 | self.views[view.view_type] = $.extend({}, view, { |
611 | @@ -1157,10 +1157,8 @@ |
612 | this.$('.oe_form_dropdown_section').each(function() { |
613 | $(this).toggle(!!$(this).find('li').length); |
614 | }); |
615 | - |
616 | - self.$("[title]").tipsy({ |
617 | - 'html': true, |
618 | - 'delayIn': 500, |
619 | + self.$("[title]").tooltip({ |
620 | + delay: { show: 500, hide: 0} |
621 | }); |
622 | }, |
623 | /** |
624 | |
625 | === modified file 'addons/web/static/src/xml/base.xml' |
626 | --- addons/web/static/src/xml/base.xml 2014-04-15 13:39:14 +0000 |
627 | +++ addons/web/static/src/xml/base.xml 2014-04-17 14:05:17 +0000 |
628 | @@ -943,7 +943,6 @@ |
629 | </t> |
630 | <t t-name="FormRenderingLabel"> |
631 | <label t-att-for="_for" |
632 | - t-att-title="help" |
633 | t-attf-class="#{classnames} oe_form_label#{help ? '_help' : ''} oe_align_#{align}"> |
634 | <t t-esc="string"/> |
635 | </label> |
636 | @@ -1005,7 +1004,7 @@ |
637 | </li> |
638 | <li t-if="widget.field and widget.field.selection" data-item="selection"> |
639 | <span class="oe_tooltip_technical_title">Selection:</span> |
640 | - <ul> |
641 | + <ul class="oe_tooltip_technical"> |
642 | <li t-foreach="widget.field.selection" t-as="option"> |
643 | [<t t-esc="option[0]"/>] |
644 | <t t-if="option[1]"> - </t> |
645 | |
646 | === modified file 'addons/web_kanban/static/src/js/kanban.js' |
647 | --- addons/web_kanban/static/src/js/kanban.js 2014-03-05 11:33:07 +0000 |
648 | +++ addons/web_kanban/static/src/js/kanban.js 2014-04-17 14:05:17 +0000 |
649 | @@ -441,7 +441,7 @@ |
650 | }, |
651 | on_record_moved : function(record, old_group, old_index, new_group, new_index) { |
652 | var self = this; |
653 | - $.fn.tipsy.clear(); |
654 | + record.$el.find('[title]').tooltip('destroy'); |
655 | $(old_group.$el).add(new_group.$el).find('.oe_kanban_aggregates, .oe_kanban_group_length').hide(); |
656 | if (old_group === new_group) { |
657 | new_group.records.splice(old_index, 1); |
658 | @@ -648,7 +648,7 @@ |
659 | this.$records.data('widget', this); |
660 | this.$has_been_started.resolve(); |
661 | var add_btn = this.$el.find('.oe_kanban_add'); |
662 | - add_btn.tipsy({delayIn: 500, delayOut: 1000}); |
663 | + add_btn.tooltip({delay: { show: 500, hide:1000 }}); |
664 | this.$records.find(".oe_kanban_column_cards").click(function (ev) { |
665 | if (ev.target == ev.currentTarget) { |
666 | if (!self.state.folded) { |
667 | @@ -688,7 +688,7 @@ |
668 | return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by]) |
669 | .filter([["id", "=", this.value]]).first().then(function(res) { |
670 | self.tooltip = res[options.tooltip_on_group_by]; |
671 | - self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tipsy({html: true}); |
672 | + self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tooltip(); |
673 | }); |
674 | } |
675 | }, |
676 | @@ -925,10 +925,8 @@ |
677 | bind_events: function() { |
678 | var self = this; |
679 | this.setup_color_picker(); |
680 | - this.$el.find('[tooltip]').tipsy({ |
681 | - delayIn: 500, |
682 | - delayOut: 0, |
683 | - fade: true, |
684 | + this.$el.find('[title]').tooltip({ |
685 | + delay: { show: 500, hide: 0}, |
686 | title: function() { |
687 | var template = $(this).attr('tooltip'); |
688 | if (!self.view.qweb.has_template(template)) { |
689 | @@ -936,10 +934,6 @@ |
690 | } |
691 | return self.view.qweb.render(template, self.qweb_context); |
692 | }, |
693 | - gravity: 's', |
694 | - html: true, |
695 | - opacity: 0.8, |
696 | - trigger: 'hover' |
697 | }); |
698 | |
699 | // If no draghandle is found, make the whole card as draghandle (provided one can edit) |
700 | |
701 | === modified file 'addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js' |
702 | --- addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js 2014-01-06 13:16:05 +0000 |
703 | +++ addons/web_kanban_sparkline/static/src/js/kanban_sparkline.js 2014-04-17 14:05:17 +0000 |
704 | @@ -29,7 +29,7 @@ |
705 | } |
706 | }, self.options); |
707 | self.$el.sparkline(value, sparkline_options); |
708 | - self.$el.tipsy({'delayIn': self.options.delayIn || 0, 'html': true, 'title': function(){return title}, 'gravity': 'n'}); |
709 | + self.$el.tooltip({delay: {show: self.options.delayIn || 0, hide: 0}, title: function(){return title}}); |
710 | }, 0); |
711 | }, |
712 | }); |
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?