From 26afdd6bcd1bee6599cf5f0f6620684a3a6bb65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hrani=C4=8Dka?= Date: Wed, 10 Jun 2015 17:43:01 +0200 Subject: [PATCH] Preserve checkbox title attribute [Closes #46] --- js/bootstrap-toggle.js | 1 + js/bootstrap-toggle.min.js | 2 +- js/bootstrap-toggle.min.js.map | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/bootstrap-toggle.js b/js/bootstrap-toggle.js index 533914e..0dbda56 100644 --- a/js/bootstrap-toggle.js +++ b/js/bootstrap-toggle.js @@ -63,6 +63,7 @@ var $toggle = $('
') .addClass( this.$element.prop('checked') ? this._onstyle : this._offstyle+' off' ) .addClass(size).addClass(this.options.style) + .attr('title', this.$element.prop('title')) this.$element.wrap($toggle) $.extend(this, { diff --git a/js/bootstrap-toggle.min.js b/js/bootstrap-toggle.min.js index 3711320..c3be96e 100644 --- a/js/bootstrap-toggle.min.js +++ b/js/bootstrap-toggle.min.js @@ -5,5 +5,5 @@ * Copyright 2014 Min Hur, The New York Times Company * Licensed under MIT * ======================================================================== */ -+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('