summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-07-31 16:10:51 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-07-31 16:10:51 +0200
commite3e37008e8fe1cbc42622445d4b4bb54e7aa96cb (patch)
tree4040e282d2a302106942a695821f226583e3e9b3 /addons/web/static/src
parent2e0ab8a6a178e8fd90e047b67af7e63a1743a2ff (diff)
parent93cb71c2260cb3b4de1f8b6f0dbe0181db445151 (diff)
[FIX] problem with focus when you enter form view
bzr revid: nicolas.vanhoren@openerp.com-20120731141051-4hs9lf32713n8cil
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/chrome.js3
-rw-r--r--addons/web/static/src/js/view_form.js4
2 files changed, 3 insertions, 4 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index a1759397e21..7c4cdf969f1 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -896,7 +896,8 @@ instance.web.Client = instance.web.Widget.extend({
this.$element.on('click', '.oe_dropdown_toggle', function(ev) {
ev.preventDefault();
var $toggle = $(this);
- var $menu = $toggle.parent().find('.oe_dropdown_menu');
+ var $menu = $toggle.siblings('.oe_dropdown_menu');
+ $menu = $menu.size() >= 1 ? $menu : $toggle.find('.oe_dropdown_menu');
var state = $menu.is('.oe_opened');
setTimeout(function() {
// Do not alter propagation
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 65afd4a36d6..453de5670c9 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -267,7 +267,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
if (this.$pager) {
this.$pager.show();
}
- this.$element.show().css('visibility', 'hidden');
this.$element.add(this.$buttons).removeClass('oe_form_dirty');
var shown = this.has_been_loaded;
@@ -286,7 +285,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
if (options.editable) {
self.to_edit_mode();
}
- self.$element.css('visibility', 'visible');
});
},
do_hide: function () {
@@ -2074,7 +2072,7 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we
return this.get('value') === '' || this._super();
},
focus: function() {
- this.delay_focus(this.$element.find('input:first'));
+ this.$element.find('input:first')[0].focus();
}
});