|
1 | 1 | /** |
2 | 2 | * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches. |
3 | 3 | * |
4 | | - * @version v3.3.5 |
| 4 | + * @version v3.4.0 |
5 | 5 | * @homepage https://bttstrp.github.io/bootstrap-switch |
6 | 6 | * @author Mattia Larentis <[email protected]> (http://larentis.eu) |
7 | 7 | * @license MIT |
|
79 | 79 | inverse = options.inverse; |
80 | 80 |
|
81 | 81 | return [state ? 'on' : 'off', size, disabled ? 'disabled' : undefined, readonly ? 'readonly' : undefined, indeterminate ? 'indeterminate' : undefined, inverse ? 'inverse' : undefined, id ? 'id-' + id : undefined].filter(function (v) { |
82 | | - return v == null; |
| 82 | + return v != null; |
83 | 83 | }); |
84 | 84 | } |
85 | 85 |
|
|
129 | 129 | function prvcontainerPosition() { |
130 | 130 | var _this2 = this; |
131 | 131 |
|
132 | | - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.ope; |
| 132 | + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.state; |
133 | 133 |
|
134 | 134 | this.$container.css('margin-left', function () { |
135 | 135 | var values = [0, '-' + _this2.privateHandleWidth + 'px']; |
|
345 | 345 | function prvgetClasses(classes) { |
346 | 346 | var _this8 = this; |
347 | 347 |
|
348 | | - if (!$.isArray(classes)) { |
| 348 | + if (!Array.isArray(classes)) { |
349 | 349 | return [prvgetClass.call(this, classes)]; |
350 | 350 | } |
351 | 351 | return classes.map(function (v) { |
|
373 | 373 | }); |
374 | 374 | this.$container = $('<div>', { class: prvgetClass.call(this, 'container') }); |
375 | 375 | this.$on = $('<span>', { |
376 | | - html: this.options.onText, |
| 376 | + text: this.options.onText, |
377 | 377 | class: prvgetClass.call(this, 'handle-on') + ' ' + prvgetClass.call(this, this.options.onColor) |
378 | 378 | }); |
379 | 379 | this.$off = $('<span>', { |
380 | | - html: this.options.offText, |
| 380 | + text: this.options.offText, |
381 | 381 | class: prvgetClass.call(this, 'handle-off') + ' ' + prvgetClass.call(this, this.options.offColor) |
382 | 382 | }); |
383 | 383 | this.$label = $('<span>', { |
384 | | - html: this.options.labelText, |
| 384 | + text: this.options.labelText, |
385 | 385 | class: prvgetClass.call(this, 'label') |
386 | 386 | }); |
387 | 387 |
|
|
606 | 606 | if (typeof value === 'undefined') { |
607 | 607 | return this.options.onText; |
608 | 608 | } |
609 | | - this.$on.html(value); |
| 609 | + this.$on.text(value); |
610 | 610 | prvwidth.call(this); |
611 | 611 | prvcontainerPosition.call(this); |
612 | 612 | this.options.onText = value; |
|
618 | 618 | if (typeof value === 'undefined') { |
619 | 619 | return this.options.offText; |
620 | 620 | } |
621 | | - this.$off.html(value); |
| 621 | + this.$off.text(value); |
622 | 622 | prvwidth.call(this); |
623 | 623 | prvcontainerPosition.call(this); |
624 | 624 | this.options.offText = value; |
|
630 | 630 | if (typeof value === 'undefined') { |
631 | 631 | return this.options.labelText; |
632 | 632 | } |
633 | | - this.$label.html(value); |
| 633 | + this.$label.text(value); |
634 | 634 | prvwidth.call(this); |
635 | 635 | this.options.labelText = value; |
636 | 636 | return this.$element; |
|
756 | 756 | offColor: 'default', |
757 | 757 | onText: 'ON', |
758 | 758 | offText: 'OFF', |
759 | | - labelText: ' ', |
| 759 | + labelText: '\xa0', |
760 | 760 | handleWidth: 'auto', |
761 | 761 | labelWidth: 'auto', |
762 | 762 | baseClass: 'bootstrap-switch', |
|
0 commit comments