forked from 0x2620/oxjs
fix a regression with regards to the disabled state of form elements (jquery 1.6 attr() has changed)
This commit is contained in:
parent
609f834cd3
commit
e1eb3feb49
3 changed files with 25 additions and 13 deletions
|
|
@ -205,10 +205,11 @@ Ox.Input = function(options, self) {
|
|||
|
||||
self.$input = $(self.options.type == 'textarea' ? '<textarea>' : '<input>')
|
||||
.addClass('OxInput OxMedium Ox' + Ox.toTitleCase(self.options.style))
|
||||
.attr({
|
||||
disabled: self.options.disabled ? 'disabled' : '',
|
||||
.attr(Ox.extend({
|
||||
type: self.options.type == 'password' ? 'password' : 'text'
|
||||
})
|
||||
}, self.options.disabled ? {
|
||||
disabled: 'disabled'
|
||||
} : {})
|
||||
.css(Ox.extend({
|
||||
width: self.inputWidth + 'px',
|
||||
textAlign: self.options.textAlign
|
||||
|
|
@ -793,9 +794,11 @@ Ox.Input = function(options, self) {
|
|||
}
|
||||
self.bindKeyboard = self.options.autocomplete || self.options.autovalidate;
|
||||
} else if (key == 'disabled') {
|
||||
self.$input.attr({
|
||||
disabled: value ? 'disabled' : ''
|
||||
});
|
||||
if (value) {
|
||||
self.$input.attr({disabled: 'disabled'});
|
||||
} else {
|
||||
self.$input.removeAttr('disabled');
|
||||
}
|
||||
} else if (key == 'height') {
|
||||
that.css({
|
||||
height: value + 'px'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue