|
@@ -44,7 +44,8 @@
|
|
offText: this.$element.data("off-text"),
|
|
offText: this.$element.data("off-text"),
|
|
labelText: this.$element.data("label-text"),
|
|
labelText: this.$element.data("label-text"),
|
|
baseClass: this.$element.data("base-class"),
|
|
baseClass: this.$element.data("base-class"),
|
|
- wrapperClass: this.$element.data("wrapper-class")
|
|
|
|
|
|
+ wrapperClass: this.$element.data("wrapper-class"),
|
|
|
|
+ radioAllOff: this.$element.data("radio-all-off")
|
|
}, options);
|
|
}, options);
|
|
this.$wrapper = $("<div>", {
|
|
this.$wrapper = $("<div>", {
|
|
"class": (function(_this) {
|
|
"class": (function(_this) {
|
|
@@ -120,7 +121,7 @@
|
|
if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
|
|
if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
|
|
return this.$element;
|
|
return this.$element;
|
|
}
|
|
}
|
|
- if (this.options.state && this.$element.is(':radio')) {
|
|
|
|
|
|
+ if (this.options.state && !this.options.radioAllOff && this.$element.is(':radio')) {
|
|
return this.$element;
|
|
return this.$element;
|
|
}
|
|
}
|
|
value = !!value;
|
|
value = !!value;
|
|
@@ -285,6 +286,14 @@
|
|
return this.$element;
|
|
return this.$element;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ BootstrapSwitch.prototype.radioAllOff = function(value) {
|
|
|
|
+ if (typeof value === "undefined") {
|
|
|
|
+ return this.options.radioAllOff;
|
|
|
|
+ }
|
|
|
|
+ this.options.radioAllOff = value;
|
|
|
|
+ return this.$element;
|
|
|
|
+ };
|
|
|
|
+
|
|
BootstrapSwitch.prototype.onInit = function(value) {
|
|
BootstrapSwitch.prototype.onInit = function(value) {
|
|
if (typeof value === "undefined") {
|
|
if (typeof value === "undefined") {
|
|
return this.options.onInit;
|
|
return this.options.onInit;
|
|
@@ -514,6 +523,7 @@
|
|
labelText: " ",
|
|
labelText: " ",
|
|
baseClass: "bootstrap-switch",
|
|
baseClass: "bootstrap-switch",
|
|
wrapperClass: "wrapper",
|
|
wrapperClass: "wrapper",
|
|
|
|
+ radioAllOff: false,
|
|
onInit: function() {},
|
|
onInit: function() {},
|
|
onSwitchChange: function() {}
|
|
onSwitchChange: function() {}
|
|
};
|
|
};
|