diff --git a/source/Ox.UI/js/Form/Ox.Button.js b/source/Ox.UI/js/Form/Ox.Button.js index 612c88cc..db9df19e 100644 --- a/source/Ox.UI/js/Form/Ox.Button.js +++ b/source/Ox.UI/js/Form/Ox.Button.js @@ -43,11 +43,10 @@ Ox.Button = function(options, self) { width: 'auto' }) .options(options || {}) - .attr(Ox.extend({ + .attr({ + disabled: self.options.disabled, type: self.options.type == 'text' ? 'button' : 'image' - }, self.options.disabled ? { - disabled: 'disabled' - } : {})) + }) .addClass('OxButton Ox' + Ox.toTitleCase(self.options.size) + (self.options.disabled ? ' OxDisabled': '') + (self.options.selected ? ' OxSelected': '') + @@ -132,12 +131,8 @@ Ox.Button = function(options, self) { self.setOption = function(key, value) { if (key == 'disabled') { - if (value) { - that.attr({disabled: 'disabled'}) - } else { - that.removeAttr('disabled'); - } - that.toggleClass('OxDisabled'); + that.attr({disabled: value}) + .toggleClass('OxDisabled'); } else if (key == 'selected') { if (value != that.hasClass('OxSelected')) { // fixme: neccessary? that.toggleClass('OxSelected'); diff --git a/source/Ox.UI/js/Form/Ox.Checkbox.js b/source/Ox.UI/js/Form/Ox.Checkbox.js index 92a48e55..ebd4f511 100644 --- a/source/Ox.UI/js/Form/Ox.Checkbox.js +++ b/source/Ox.UI/js/Form/Ox.Checkbox.js @@ -37,9 +37,9 @@ Ox.Checkbox = function(options, self) { (self.options.overlap == 'none' ? '' : ' OxOverlap' + Ox.toTitleCase(self.options.overlap)) ) - .attr(self.options.disabled ? { - disabled: 'disabled' - } : {}); + .attr({ + disabled: self.options.disabled + }); if (self.options.title) { self.options.width != 'auto' && that.css({ @@ -102,11 +102,7 @@ Ox.Checkbox = function(options, self) { if (key == 'checked') { that.toggleChecked(); } else if (key == 'disabled') { - if (value) { - that.attr({disabled: 'disabled'}) - } else { - that.removeAttr('disabled'); - } + that.attr({disabled: value}) } else if (key == 'title') { self.$title.options({title: value}); } diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index 791626c4..a559563e 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -205,11 +205,10 @@ Ox.Input = function(options, self) { self.$input = $(self.options.type == 'textarea' ? '