/*\ |*| ======================================================================== |*| Bootstrap Toggle: bootstrap4-toggle.js v3.6.1 |*| https://gitbrent.github.io/bootstrap4-toggle/ |*| ======================================================================== |*| Copyright 2018-2019 Brent Ely |*| Licensed under MIT |*| ======================================================================== \*/ +function ($) { 'use strict'; // TOGGLE PUBLIC CLASS DEFINITION // ============================== var Toggle = function (element, options) { this.$element = $(element) this.options = $.extend({}, this.defaults(), options) this.render() } Toggle.VERSION = '3.7.0-beta' Toggle.DEFAULTS = { on: 'On', off: 'Off', onstyle: 'primary', offstyle: 'light', size: 'normal', style: '', width: null, height: null } Toggle.prototype.defaults = function() { return { on: this.$element.attr('data-on') || Toggle.DEFAULTS.on, off: this.$element.attr('data-off') || Toggle.DEFAULTS.off, onstyle: this.$element.attr('data-onstyle') || Toggle.DEFAULTS.onstyle, offstyle: this.$element.attr('data-offstyle') || Toggle.DEFAULTS.offstyle, size: this.$element.attr('data-size') || Toggle.DEFAULTS.size, style: this.$element.attr('data-style') || Toggle.DEFAULTS.style, width: this.$element.attr('data-width') || Toggle.DEFAULTS.width, height: this.$element.attr('data-height') || Toggle.DEFAULTS.height } } Toggle.prototype.render = function () { this._onstyle = 'btn-' + this.options.onstyle this._offstyle = 'btn-' + this.options.offstyle var size = this.options.size === 'large' || this.options.size === 'lg' ? 'btn-lg' : this.options.size === 'small' || this.options.size === 'sm' ? 'btn-sm' : this.options.size === 'mini' || this.options.size === 'xs' ? 'btn-xs' : '' var $toggleOn = $('