[FIX] problem with focus when you enter form view

bzr revid: nicolas.vanhoren@openerp.com-20120731141051-4hs9lf32713n8cil
This commit is contained in:
niv-openerp 2012-07-31 16:10:51 +02:00
commit e3e37008e8
3 changed files with 9 additions and 7 deletions

View File

@ -426,10 +426,13 @@ class DisableCacheMiddleware(object):
referer = environ.get('HTTP_REFERER', '')
parsed = urlparse.urlparse(referer)
debug = parsed.query.count('debug') >= 1
filtered_headers = [(k,v) for k,v in headers if not (k=='Last-Modified' or (debug and (k=='Cache-Control' or k=='Expires')))]
nh = dict(headers)
if 'Last-Modified' in nh: del nh['Last-Modified']
if debug:
filtered_headers.append(('Cache-Control', 'no-cache'))
start_response(status, filtered_headers)
if 'Expires' in nh: del nh['Expires']
if 'Etag' in nh: del nh['Etag']
nh['Cache-Control'] = 'no-cache'
start_response(status, nh.items())
return self.app(environ, start_wrapped)
class Root(object):

View File

@ -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

View File

@ -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();
}
});