diff options
| author | Simon Lejeune <sle@openerp.com> | 2014-04-29 14:42:37 +0200 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2014-04-29 14:42:37 +0200 |
| commit | 6bef64f513ee744ac016e2dd98e9e29bad947f94 (patch) | |
| tree | 5613064dcf2c9e7558f8a4010930fbb025457d9a /addons/web/static/src | |
| parent | 545e8ae52923ba7f0daa8810036a3a169c32cf6a (diff) | |
| parent | 6f51331d52bed117f5a060addf4ee12608ea2236 (diff) | |
[MERGE] trunk
bzr revid: sle@openerp.com-20140422123804-dnjnwfyfrpxjgrlo
bzr revid: sle@openerp.com-20140424124720-ihcrqojmnmj0k66q
bzr revid: sle@openerp.com-20140428162227-sbvq5ogtshpz0vw6
bzr revid: sle@openerp.com-20140429124237-dhk3378fvche068v
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 4 | ||||
| -rw-r--r-- | addons/web/static/src/css/base.sass | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/core.js | 13 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 23 |
4 files changed, 38 insertions, 4 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 023c80877ef..916e4ffe9ba 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1890,7 +1890,7 @@ .openerp .oe_form > :not(.oe_form_nosheet) header { padding-left: 2px; } -.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical) { +.openerp .oe_form > :not(.oe_form_nosheet) header ul:not(.oe_tooltip_technical):not(.oe_dropdown_menu) { display: inline-block; float: right; } @@ -3307,6 +3307,8 @@ body.oe_single_form .oe_single_form_container { background: white; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); background-color: transparent; + /*We need a greater z-index in order for tooltip to go over bootstrap modal z-index*/ + z-index: 1500; } .tooltip .tooltip-inner { text-align: left !important; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 84758c062cb..d83b09bc897 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1550,7 +1550,7 @@ $sheet-padding: 16px // FormView.header {{{ .oe_form > :not(.oe_form_nosheet) header padding-left: 2px - ul:not(.oe_tooltip_technical) + ul:not(.oe_tooltip_technical):not(.oe_dropdown_menu) display: inline-block float: right .oe_button diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index b7e15f9eaa0..74866112d99 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -787,8 +787,19 @@ instance.web.unblockUI = function() { /* Bootstrap defaults overwrite */ -$.fn.tooltip.Constructor.DEFAULTS.placement = 'bottom'; +$.fn.tooltip.Constructor.DEFAULTS.placement = 'auto top'; $.fn.tooltip.Constructor.DEFAULTS.html = true; +$.fn.tooltip.Constructor.DEFAULTS.container = 'body'; +//overwrite bootstrap tooltip method to fix bug when using placement +//auto and the parent element does not exist anymore resulting in +//an error. This should be remove once bootstrap fix the bug +var bootstrap_show_function = $.fn.tooltip.Constructor.prototype.show; +$.fn.tooltip.Constructor.prototype.show = function (e) { + if (this.$element.parent().length === 0){ + return; + } + return bootstrap_show_function.call(this, e); +}; /** * 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 6212cc3d549..cbd74105aba 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -730,8 +730,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } } }, - on_button_save: function() { + on_button_save: function(e) { var self = this; + $(e.target).attr("disabled", true); return this.save().done(function(result) { self.trigger("save", result); self.reload().then(function() { @@ -741,6 +742,8 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM parent.menu.do_reload_needaction(); } }); + }).always(function(){ + $(e.target).attr("disabled", false); }); }, on_button_cancel: function(event) { @@ -1866,9 +1869,25 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi do_attach_tooltip: function(widget, trigger, options) { widget = widget || this; trigger = trigger || this.$el; + var container = 'body'; + /*TODO: need to be refactor + in the case we can find the view form in the parent, + attach the element to it (to prevent tooltip to keep showing + when switching view) or if we have a modal currently showing, + attach tooltip to the modal to prevent the tooltip to show in the body in the + case we close the modal too fast*/ + if ($(trigger).parents('.oe_view_manager_view_form').length > 0){ + container = $(trigger).parents('.oe_view_manager_view_form'); + } + else { + if (window.$('.modal.in').length>0){ + container = window.$('.modal.in:last()'); + } + } options = _.extend({ delay: { show: 500, hide: 0 }, trigger: 'hover', + container: container, title: function() { var template = widget.template + '.tooltip'; if (!QWeb.has_template(template)) { @@ -3602,6 +3621,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc minLength: 0, delay: 250 }); + // set position for list of suggestions box + this.$input.autocomplete( "option", "position", { my : "left top", at: "left bottom" } ); this.$input.autocomplete("widget").openerpClass(); // used to correct a bug when selecting an element by pushing 'enter' in an editable list this.$input.keyup(function(e) { |
