Skip to content

Commit ec69b5d

Browse files
author
Emanuele Marchi
committed
v3.3.2
1 parent 2624eea commit ec69b5d

35 files changed

+467
-614
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "components"
3+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.grunt
22
npm-debug.log
33
node_modules
4-
bower_components
4+
components
55
.DS_Store

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 3.3.2
4+
5+
- Fix for Flicker on initialisation [#425](https://github.com/nostalgiaz/bootstrap-switch/issues/425), [#422](https://github.com/nostalgiaz/bootstrap-switch/issues/422)
6+
- Prevent horizontal misalignment inside modal in page with odd width [#414](https://github.com/nostalgiaz/bootstrap-switch/issues/414)
7+
38
## 3.3.1
49

510
- Revert of switchChange event triggered only on falsy skip [#411](https://github.com/nostalgiaz/bootstrap-switch/issues/411)

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bootstrap-switch",
33
"description": "Turn checkboxes and radio buttons in toggle switches.",
4-
"version": "3.3.1",
4+
"version": "3.3.2",
55
"main": [
66
"./dist/js/bootstrap-switch.js",
77
"./dist/css/bootstrap3/bootstrap-switch.css"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "components/bootstrap-switch",
33
"description": "Turn checkboxes and radio buttons in toggle switches.",
4-
"version": "3.3.1",
4+
"version": "3.3.2",
55
"type": "component",
66
"keywords": [
77
"bootstrap",

dist/css/bootstrap2/bootstrap-switch.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* bootstrap-switch - v3.3.1
2+
* bootstrap-switch - v3.3.2
33
* http://www.bootstrap-switch.org
44
* ========================================================================
55
* Copyright 2012-2013 Mattia Larentis

dist/css/bootstrap2/bootstrap-switch.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/bootstrap3/bootstrap-switch.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* bootstrap-switch - v3.3.1
2+
* bootstrap-switch - v3.3.2
33
* http://www.bootstrap-switch.org
44
* ========================================================================
55
* Copyright 2012-2013 Mattia Larentis

dist/css/bootstrap3/bootstrap-switch.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/bootstrap-switch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* bootstrap-switch - v3.3.1
2+
* bootstrap-switch - v3.3.2
33
* http://www.bootstrap-switch.org
44
* ========================================================================
55
* Copyright 2012-2013 Mattia Larentis

dist/js/bootstrap-switch.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/css/bootstrap.min.css

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

docs/css/main.css

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,24 @@ body {
22
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
33
padding-bottom: 50px;
44
}
5-
65
.bs-docs-masthead,
76
.bs-docs-header {
87
color: #cdbfe3;
9-
text-shadow: 0 1px 0 rgba(0,0,0,.1);
8+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
109
background-color: #6f5499;
11-
background-image: -webkit-gradient(linear,left top,left bottom,from(#563d7c),to(#6f5499));
12-
background-image:-webkit-linear-gradient(top,#563d7c 0,#6f5499 100%);
13-
background-image:-o-linear-gradient(top,#563d7c 0,#6f5499 100%);
14-
background-image:linear-gradient(to bottom,#563d7c 0,#6f5499 100%);
15-
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);
16-
background-repeat:repeat-x
17-
}
18-
10+
background-image: -webkit-gradient(linear, left top, left bottom, from(#563d7c), to(#6f5499));
11+
background-image: -webkit-linear-gradient(top, #563d7c 0, #6f5499 100%);
12+
background-image: -o-linear-gradient(top, #563d7c 0, #6f5499 100%);
13+
background-image: linear-gradient(to bottom, #563d7c 0, #6f5499 100%);
14+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);
15+
background-repeat: repeat-x;
16+
}
1917
.bs-docs-masthead h1 {
2018
font-weight: 500;
2119
}
22-
2320
.page-header {
2421
text-align: left;
2522
}
26-
2723
#github {
2824
display: none;
2925
position: fixed;
@@ -33,19 +29,16 @@ body {
3329
right: 0;
3430
z-index: 2000;
3531
}
36-
3732
.bottom {
3833
border-top: 1px solid #eee;
3934
margin-top: 40px;
4035
padding-top: 20px;
4136
padding-bottom: 20px;
4237
text-align: center;
4338
}
44-
4539
.hljs {
4640
background-color: transparent;
4741
}
48-
4942
@media (min-width: 768px) {
5043
#github {
5144
display: block;

docs/js/bootstrap.min.js

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

docs/js/jquery.min.js

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

docs/js/main.js

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,61 @@
1-
$(function() {
2-
var $window = $(window);
3-
var sectionTop = $('.top').outerHeight() + 20;
4-
var $createDestroy = $('#switch-create-destroy');
5-
6-
// initialize highlight.js
7-
hljs.initHighlightingOnLoad();
8-
9-
// navigation
10-
$('a[href*="#"]').on('click', function(event) {
11-
event.preventDefault();
12-
var $target = $($(this).attr('href').slice('#'));
13-
14-
if ($target.length) {
15-
$window.scrollTop($target.offset().top - sectionTop);
16-
}
17-
});
18-
19-
// initialize all the inputs
20-
$('input[type="checkbox"], input[type="radio"]')
21-
.not("[data-switch-no-init]")
22-
.bootstrapSwitch();
23-
24-
$('[data-switch-get]').on("click", function() {
25-
var type = $(this).data('switch-get');
26-
27-
alert($('#switch-' + type).bootstrapSwitch(type));
28-
});
29-
30-
$('[data-switch-set]').on('click', function() {
31-
var type = $(this).data('switch-set');
32-
33-
$('#switch-' + type).bootstrapSwitch(type, $(this).data('switch-value'));
1+
(function() {
2+
var $confirm;
3+
4+
$confirm = null;
5+
6+
$(function() {
7+
var $createDestroy, $window, sectionTop;
8+
$window = $(window);
9+
sectionTop = $(".top").outerHeight() + 20;
10+
$createDestroy = $("#switch-create-destroy");
11+
hljs.initHighlightingOnLoad();
12+
$("a[href*=\"#\"]").on("click", function(event) {
13+
var $target;
14+
event.preventDefault();
15+
$target = $($(this).attr("href").slice("#"));
16+
if ($target.length) {
17+
return $window.scrollTop($target.offset().top - sectionTop);
18+
}
19+
});
20+
$("input[type=\"checkbox\"], input[type=\"radio\"]").not("[data-switch-no-init]").bootstrapSwitch();
21+
$("[data-switch-get]").on("click", function() {
22+
var type;
23+
type = $(this).data("switch-get");
24+
return alert($("#switch-" + type).bootstrapSwitch(type));
25+
});
26+
$("[data-switch-set]").on("click", function() {
27+
var type;
28+
type = $(this).data("switch-set");
29+
return $("#switch-" + type).bootstrapSwitch(type, $(this).data("switch-value"));
30+
});
31+
$("[data-switch-toggle]").on("click", function() {
32+
var type;
33+
type = $(this).data("switch-toggle");
34+
return $("#switch-" + type).bootstrapSwitch("toggle" + type.charAt(0).toUpperCase() + type.slice(1));
35+
});
36+
$("[data-switch-set-value]").on("input", function(event) {
37+
var type, value;
38+
event.preventDefault();
39+
type = $(this).data("switch-set-value");
40+
value = $.trim($(this).val());
41+
if ($(this).data("value") === value) {
42+
return;
43+
}
44+
return $("#switch-" + type).bootstrapSwitch(type, value);
45+
});
46+
$("[data-switch-create-destroy]").on("click", function() {
47+
var isSwitch;
48+
isSwitch = $createDestroy.data("bootstrap-switch");
49+
$createDestroy.bootstrapSwitch((isSwitch ? "destroy" : null));
50+
return $(this).button((isSwitch ? "reset" : "destroy"));
51+
});
52+
return $confirm = $("#confirm").bootstrapSwitch({
53+
size: "large",
54+
onSwitchChange: function(event, state) {
55+
event.preventDefault();
56+
return console.log(state, event.isDefaultPrevented());
57+
}
58+
});
3459
});
3560

36-
$('[data-switch-toggle]').on('click', function() {
37-
var type = $(this).data('switch-toggle');
38-
39-
$('#switch-' + type).bootstrapSwitch('toggle' + type.charAt(0).toUpperCase() + type.slice(1));
40-
});
41-
42-
$('[data-switch-set-value]').on('input', function(event) {
43-
event.preventDefault();
44-
var type = $(this).data('switch-set-value');
45-
var value = $.trim($(this).val());
46-
47-
if ($(this).data('value') == value) {
48-
return;
49-
}
50-
51-
$('#switch-' + type).bootstrapSwitch(type, value);
52-
});
53-
54-
$('[data-switch-create-destroy]').on('click', function() {
55-
var isSwitch = $createDestroy.data('bootstrap-switch');
56-
57-
$createDestroy.bootstrapSwitch(isSwitch ? 'destroy' : null);
58-
$(this).button(isSwitch ? 'reset' : 'destroy');
59-
});
60-
});
61+
}).call(this);

events-3.html

Lines changed: 0 additions & 108 deletions
This file was deleted.

examples.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,6 @@ <h2 class="h4">Inside Modals</h2>
270270
</div>
271271
</div>
272272
</div>
273-
<hr>
274-
<p class="form-group">
275-
<input type="checkbox">
276-
</p>
277273
</div>
278274
</div>
279275
</main>

0 commit comments

Comments
 (0)