Skip to content

Commit ad6da59

Browse files
committed
Bump version
1 parent 9eb69e1 commit ad6da59

File tree

14 files changed

+51
-25
lines changed

14 files changed

+51
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Several quick start options are available:
1313

14-
* [Download the latest release](https://github.com/vsn4ik/bootstrap-checkbox/releases/download/v1.2.15/bootstrap-checkbox-1.2.15-dist.zip "Download Bootstrap-checkbox").
14+
* [Download the latest release](https://github.com/vsn4ik/bootstrap-checkbox/releases/download/v1.3.0/bootstrap-checkbox-1.3.0-dist.zip "Download Bootstrap-checkbox").
1515
* Clone the repo: `git clone https://github.com/vsn4ik/bootstrap-checkbox.git`.
1616
* Install with [Bower](http://bower.io): `bower install bootstrap-checkbox`.
1717
* Install with [npm](https://www.npmjs.com): `npm install bootstrap-checkbox`.

dist/js/bootstrap-checkbox.js

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/
@@ -27,16 +27,26 @@
2727
}
2828
})(function($) {
2929
$.create = function() {
30-
return $($.map(arguments, function(tagName) {
31-
return document.createElement(tagName);
32-
}));
30+
return $($.map(arguments, $.proxy(document, 'createElement')));
3331
};
3432

3533
function Checkboxpicker(element, options) {
3634
this.element = element;
3735
this.$element = $(element);
3836

39-
this.options = $.extend({}, $.fn.checkboxpicker.defaults, options, this.$element.data());
37+
var data = this.$element.data();
38+
39+
// === '': <... data-reverse>
40+
if (data.reverse === '') {
41+
data.reverse = true;
42+
}
43+
44+
// === '': <... data-switch-always>
45+
if (data.switchAlways === '') {
46+
data.switchAlways = true;
47+
}
48+
49+
this.options = $.extend({}, $.fn.checkboxpicker.defaults, options, data);
4050

4151
if (this.$element.closest('label').length) {
4252
console.warn(this.options.warningMessage);
@@ -49,11 +59,8 @@
4959
// .btn-group-justified works with <a> elements as the <button> doesn't pick up the styles
5060
this.$buttons = $.create('a', 'a').addClass('btn');
5161

52-
// === '': <... data-reverse>
53-
var reverse = this.options.reverse || this.options.reverse === '';
54-
55-
this.$off = this.$buttons.eq(reverse ? 1 : 0);
56-
this.$on = this.$buttons.eq(reverse ? 0 : 1);
62+
this.$off = this.$buttons.eq(this.options.reverse ? 1 : 0);
63+
this.$on = this.$buttons.eq(this.options.reverse ? 0 : 1);
5764

5865
this.init();
5966
}
@@ -123,7 +130,7 @@
123130
this.$group.on('keydown', $.proxy(this, 'keydown'));
124131

125132
// Don't trigger if <a> element has .disabled class, fine!
126-
this.$group.on('click', 'a:not(.active)', $.proxy(this, 'click'));
133+
this.$buttons.on('click', $.proxy(this, 'click'));
127134

128135
this.$element.on('change', $.proxy(this, 'toggleChecked'));
129136
$(this.element.labels).on('click', $.proxy(this, 'focus'));
@@ -172,8 +179,12 @@
172179
// Original behavior
173180
this.$group.trigger('focus');
174181
},
175-
click: function() {
176-
this.change(!this.element.checked);
182+
click: function(event) {
183+
var $button = $(event.target);
184+
185+
if (!$button.hasClass('active') || this.options.switchAlways) {
186+
this.change(!this.element.checked);
187+
}
177188
},
178189
change: function(value) {
179190
// Fix #12

dist/js/bootstrap-checkbox.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/i18n/es.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

dist/js/i18n/es.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

dist/js/i18n/pt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

dist/js/i18n/pt.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

dist/js/i18n/ru.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

dist/js/i18n/ru.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

dist/js/i18n/tr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Bootstrap-checkbox v1.2.15 (https://vsn4ik.github.io/bootstrap-checkbox/)
2+
* Bootstrap-checkbox v1.3.0 (https://vsn4ik.github.io/bootstrap-checkbox/)
33
* Copyright 2013-2016 Vasily A. (https://github.com/vsn4ik)
44
* Licensed under the MIT license
55
*/

0 commit comments

Comments
 (0)