validate: function() {
this.invalid = false;
},
- focus: function() {
+ focus: function($element) {
+ if ($element) {
+ setTimeout(function() {
+ $element.focus();
+ }, 50);
+ }
},
reset: function() {
this.dirty = false;
this.invalid = true;
}
},
- focus: function() {
- this.$element.find('input').focus();
+ focus: function($element) {
+ this._super($element || this.$element.find('input:first'));
}
});
}
}
},
- focus: function() {
- this.$input.focus();
+ focus: function($element) {
+ this._super($element || this.$input);
},
parse_client: function(v) {
return openerp.web.parse_value(v, {"widget": this.type_of_date});
validate: function() {
this.invalid = !this.datewidget.is_valid(this.required);
},
- focus: function() {
- this.datewidget.focus();
+ focus: function($element) {
+ this._super($element || this.datewidget);
}
});
this.invalid = true;
}
},
- focus: function() {
- this.$element.find('textarea').focus();
+ focus: function($element) {
+ this._super($element || this.$element.find('textarea:first'));
},
do_resize: function(max_height) {
max_height = parseInt(max_height, 10);
this._super.apply(this, arguments);
this.$element.find('input').prop('disabled', this.readonly);
},
- focus: function() {
- this.$element.find('input').focus();
+ focus: function($element) {
+ this._super($element || this.$element.find('input:first'));
}
});
var value = this.values[this.$element.find('select')[0].selectedIndex];
this.invalid = !(value && !(this.required && value[0] === false));
},
- focus: function() {
- this.$element.find('select').focus();
+ focus: function($element) {
+ this._super($element || this.$element.find('select:first'));
}
});
self.do_action(result.result);
});
},
- focus: function () {
- this.$input.focus();
+ focus: function ($element) {
+ this._super($element || this.$input);
},
update_dom: function() {
this._super.apply(this, arguments);