Skip to content

Commit

Permalink
Check disabled values properly
Browse files Browse the repository at this point in the history
  • Loading branch information
abpetkov committed Jun 26, 2015
1 parent b3fbb8b commit 992d30b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions switchery.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ Switchery.prototype.enable = function() {
*/

Switchery.prototype.disable = function() {
if (this.options.disabled) this.options.disabled = true;
if (this.element.disabled) this.element.disabled = true;
if (this.element.readOnly) this.element.readOnly = true;
if (!this.options.disabled) this.options.disabled = true;
if (!this.element.disabled) this.element.disabled = true;
if (!this.element.readOnly) this.element.readOnly = true;
this.switcher.style.opacity = this.options.disabledOpacity;
this.destroy();
};

0 comments on commit 992d30b

Please sign in to comment.