diff options
| author | Simon Lejeune <sle@openerp.com> | 2014-04-17 17:02:34 +0200 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2014-04-17 17:02:34 +0200 |
| commit | 545e8ae52923ba7f0daa8810036a3a169c32cf6a (patch) | |
| tree | b41e4609cde3175fa1a72746c94e03a9f2aea35e /addons/web/static/src | |
| parent | 6c6310bd384549f40f0d00b24b8c6ac413ff00fe (diff) | |
| parent | 1c0289ecc7ecc7f96c6821094d18b8bdc12fb15e (diff) | |
[MERGE] trunk
bzr revid: sle@openerp.com-20140417150234-45cmuz6bnandmxiv
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 84 | ||||
| -rw-r--r-- | addons/web/static/src/css/base.sass | 69 | ||||
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/core.js | 5 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 19 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 3 |
7 files changed, 109 insertions, 85 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b8c28e1660e..023c80877ef 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -478,7 +478,7 @@ display: inline-block; height: 12px; width: 12px; - vertical-align: bottom; + vertical-align: top; border-radius: 10px; margin: 1px 0; } @@ -504,40 +504,6 @@ font-style: italic; text-decoration: none; } -.openerp.oe_tooltip { - font-size: 12px; -} -.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; @@ -1924,7 +1890,7 @@ .openerp .oe_form > :not(.oe_form_nosheet) header { padding-left: 2px; } -.openerp .oe_form > :not(.oe_form_nosheet) header ul { +.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical) { display: inline-block; float: right; } @@ -3331,6 +3297,52 @@ body.oe_single_form .oe_single_form_container { width: 18px; height: 18px; } + +.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: 350px; +} +.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; +} .modal .modal-header button.close { border: none; background: none; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index a98948117f6..84758c062cb 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -452,7 +452,7 @@ $sheet-padding: 16px display: inline-block height: 12px width: 12px - vertical-align: bottom + vertical-align: top border-radius: 10px margin: 1px 0 &.oe_form_invalid @@ -472,33 +472,6 @@ $sheet-padding: 16px text-decoration: none margin-bottom: 1px // }}} - // Tooltips {{{ - &.oe_tooltip - font-size: 12px - .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 @@ -1577,7 +1550,7 @@ $sheet-padding: 16px // FormView.header {{{ .oe_form > :not(.oe_form_nosheet) header padding-left: 2px - ul + ul:not(.oe_tooltip_technical) display: inline-block float: right .oe_button @@ -2703,6 +2676,44 @@ body.oe_single_form overflow: hidden !important // }}} +// End of customize + +// Customize bootstrap3 for tooltip +.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: 350px + .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 // Hack for ui icon {{{ .ui-icon diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index fca55957fd7..3c1f55df981 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1078,8 +1078,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(); @@ -1103,7 +1103,7 @@ instance.web.Client = instance.web.Widget.extend({ }, 0); }); instance.web.bus.on('click', this, function(ev) { - $.fn.tipsy.clear(); + $.fn.tooltip('destroy'); 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/core.js b/addons/web/static/src/js/core.js index 45ed6f41c6f..b7e15f9eaa0 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -785,6 +785,11 @@ instance.web.unblockUI = function() { return $.unblockUI.apply($, arguments); }; + +/* Bootstrap defaults overwrite */ +$.fn.tooltip.Constructor.DEFAULTS.placement = 'bottom'; +$.fn.tooltip.Constructor.DEFAULTS.html = true; + /** * Registry for all the client actions key: tag value: widget */ diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 0ecd164a5e1..6212cc3d549 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1835,7 +1835,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); }, /** @@ -1867,9 +1867,8 @@ 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, + delay: { show: 500, hide: 0 }, + trigger: 'hover', title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { @@ -1880,12 +1879,12 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi widget: widget }); }, - gravity: $.fn.tipsy.autoBounds(50, 'nw'), - html: true, - opacity: 0.85, - trigger: 'hover' }, options || {}); - $(trigger).tipsy(options); + //only show tooltip if we are in debug or if we have a help to show, otherwise it will display + //as empty + if (instance.session.debug || widget.node.attrs.help || (widget.field && widget.field.help)){ + $(trigger).tooltip(options); + } }, /** * Builds a new context usable for operations related to fields by merging @@ -2122,8 +2121,8 @@ 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 + ']') : $(); + this.do_attach_tooltip(this, this.$label[0] || this.$el); if (instance.session.debug) { - this.do_attach_tooltip(this, this.$label[0] || this.$el); 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; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index dc9f706d40e..b9015f6b311 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -581,7 +581,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, { @@ -1157,10 +1157,8 @@ instance.web.Sidebar = instance.web.Widget.extend({ this.$('.oe_form_dropdown_section').each(function() { $(this).toggle(!!$(this).find('li').length); }); - - self.$("[title]").tipsy({ - 'html': true, - 'delayIn': 500, + self.$("[title]").tooltip({ + delay: { show: 500, hide: 0} }); }, /** diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index a08de0bc4bd..24c5ba625b0 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -943,7 +943,6 @@ </t> <t t-name="FormRenderingLabel"> <label t-att-for="_for" - t-att-title="help" t-attf-class="#{classnames} oe_form_label#{help ? '_help' : ''} oe_align_#{align}"> <t t-esc="string"/> </label> @@ -1005,7 +1004,7 @@ </li> <li t-if="widget.field and widget.field.selection" data-item="selection"> <span class="oe_tooltip_technical_title">Selection:</span> - <ul> + <ul class="oe_tooltip_technical"> <li t-foreach="widget.field.selection" t-as="option"> [<t t-esc="option[0]"/>] <t t-if="option[1]"> - </t> |
