Skip to content

Commit

Permalink
Renamed allowAllOff to radioAllOff, added docs entry for it
Browse files Browse the repository at this point in the history
  • Loading branch information
root-talis committed Jun 17, 2014
1 parent 516ce3a commit 82d6d5d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dist/js/bootstrap-switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
labelText: this.$element.data("label-text"),
baseClass: this.$element.data("base-class"),
wrapperClass: this.$element.data("wrapper-class"),
allowAllOff: this.$element.data("allow-all-off")
radioAllOff: this.$element.data("radio-all-off")
}, options);
this.$wrapper = $("<div>", {
"class": (function(_this) {
Expand Down Expand Up @@ -121,7 +121,7 @@
if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
return this.$element;
}
if (this.options.state && !this.options.allowAllOff && this.$element.is(':radio')) {
if (this.options.state && !this.options.radioAllOff && this.$element.is(':radio')) {
return this.$element;
}
value = !!value;
Expand Down Expand Up @@ -286,11 +286,11 @@
return this.$element;
};

BootstrapSwitch.prototype.allowAllOff = function(value) {
BootstrapSwitch.prototype.radioAllOff = function(value) {
if (typeof value === "undefined") {
return this.options.allowAllOff;
return this.options.radioAllOff;
}
this.options.allowAllOff = value;
this.options.radioAllOff = value;
return this.$element;
};

Expand Down Expand Up @@ -523,7 +523,7 @@
labelText: "&nbsp;",
baseClass: "bootstrap-switch",
wrapperClass: "wrapper",
allowAllOff: false,
radioAllOff: false,
onInit: function() {},
onSwitchChange: function() {}
};
Expand Down
Loading

0 comments on commit 82d6d5d

Please sign in to comment.