|
@@ -4,16 +4,16 @@ $(function() {
|
|
|
|
|
|
// dimension
|
|
|
$('#btn-size-regular-switch').on('click', function () {
|
|
|
- $('#dimension-switch').bootstrapSwitch('setSizeClass', '');
|
|
|
+ $('#dimension-switch').bootstrapSwitch('size', '');
|
|
|
});
|
|
|
$('#btn-size-mini-switch').on('click', function () {
|
|
|
- $('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-mini');
|
|
|
+ $('#dimension-switch').bootstrapSwitch('size', 'mini');
|
|
|
});
|
|
|
$('#btn-size-small-switch').on('click', function () {
|
|
|
- $('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-small');
|
|
|
+ $('#dimension-switch').bootstrapSwitch('size', 'small');
|
|
|
});
|
|
|
$('#btn-size-large-switch').on('click', function () {
|
|
|
- $('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-large');
|
|
|
+ $('#dimension-switch').bootstrapSwitch('size', 'large');
|
|
|
});
|
|
|
|
|
|
// state
|
|
@@ -21,10 +21,10 @@ $(function() {
|
|
|
$('#toggle-state-switch').bootstrapSwitch('toggleState');
|
|
|
});
|
|
|
$('#toggle-state-switch-button-on').on('click', function () {
|
|
|
- $('#toggle-state-switch').bootstrapSwitch('setState', true);
|
|
|
+ $('#toggle-state-switch').bootstrapSwitch('state', true);
|
|
|
});
|
|
|
$('#toggle-state-switch-button-off').on('click', function () {
|
|
|
- $('#toggle-state-switch').bootstrapSwitch('setState', false);
|
|
|
+ $('#toggle-state-switch').bootstrapSwitch('state', false);
|
|
|
});
|
|
|
$('#toggle-state-switch-button-state').on('click', function () {
|
|
|
alert($('#toggle-state-switch').bootstrapSwitch('state'));
|
|
@@ -44,39 +44,39 @@ $(function() {
|
|
|
// activation
|
|
|
var $disable = $('#disable-switch');
|
|
|
$('#btn-disable-is').on('click', function () {
|
|
|
- alert($disable.bootstrapSwitch('isDisabled'));
|
|
|
+ alert($disable.bootstrapSwitch('disabled'));
|
|
|
});
|
|
|
$('#btn-disable-toggle').on('click', function () {
|
|
|
$disable.bootstrapSwitch('toggleDisabled');
|
|
|
});
|
|
|
$('#btn-disable-set').on('click', function () {
|
|
|
- $disable.bootstrapSwitch('setDisabled', true);
|
|
|
+ $disable.bootstrapSwitch('disabled', true);
|
|
|
});
|
|
|
$('#btn-disable-remove').on('click', function () {
|
|
|
- $disable.bootstrapSwitch('setDisabled', false);
|
|
|
+ $disable.bootstrapSwitch('disabled', false);
|
|
|
});
|
|
|
|
|
|
// readonly
|
|
|
var $readonly = $('#readonly-switch');
|
|
|
$('#btn-readonly-is').on('click', function () {
|
|
|
- alert($readonly.bootstrapSwitch('isReadOnly'));
|
|
|
+ alert($readonly.bootstrapSwitch('readonly'));
|
|
|
});
|
|
|
$('#btn-readonly-toggle').on('click', function () {
|
|
|
- $readonly.bootstrapSwitch('toggleReadOnly');
|
|
|
+ $readonly.bootstrapSwitch('toggleReadonly');
|
|
|
});
|
|
|
$('#btn-readonly-set').on('click', function () {
|
|
|
- $readonly.bootstrapSwitch('setReadOnly', true);
|
|
|
+ $readonly.bootstrapSwitch('readonly', true);
|
|
|
});
|
|
|
$('#btn-readonly-remove').on('click', function () {
|
|
|
- $readonly.bootstrapSwitch('setReadOnly', false);
|
|
|
+ $readonly.bootstrapSwitch('readonly', false);
|
|
|
});
|
|
|
|
|
|
// label
|
|
|
$('#btn-label-on-switch').on('click', function() {
|
|
|
- $('#label-switch').bootstrapSwitch('setOnLabel', 'I');
|
|
|
+ $('#label-switch').bootstrapSwitch('onText', 'I');
|
|
|
});
|
|
|
$('#btn-label-off-switch').on('click', function() {
|
|
|
- $('#label-switch').bootstrapSwitch('setOffLabel', 'O');
|
|
|
+ $('#label-switch').bootstrapSwitch('offText', 'O');
|
|
|
});
|
|
|
|
|
|
$('#label-toggle-switch').on('click', function(e, data) {
|
|
@@ -87,7 +87,7 @@ $(function() {
|
|
|
});
|
|
|
|
|
|
// event handler
|
|
|
- $('#switch-change').on('switch-change', function (e, data) {
|
|
|
+ $('#switch-change').on('switchChange', function (e, data) {
|
|
|
var $element = $(data.el),
|
|
|
value = data.value;
|
|
|
|
|
@@ -96,18 +96,18 @@ $(function() {
|
|
|
|
|
|
// color
|
|
|
$('#btn-color-on-switch').on('click', function() {
|
|
|
- $('#change-color-switch').bootstrapSwitch('setOnClass', 'success');
|
|
|
+ $('#change-color-switch').bootstrapSwitch('onColor', 'success');
|
|
|
});
|
|
|
$('#btn-color-off-switch').on('click', function() {
|
|
|
- $('#change-color-switch').bootstrapSwitch('setOffClass', 'danger');
|
|
|
+ $('#change-color-switch').bootstrapSwitch('offColor', 'danger');
|
|
|
});
|
|
|
|
|
|
// animation
|
|
|
$('#btn-animate-switch').on('click', function() {
|
|
|
- $('#animated-switch').bootstrapSwitch('setAnimated', true);
|
|
|
+ $('#animated-switch').bootstrapSwitch('animate', true);
|
|
|
});
|
|
|
$('#btn-dont-animate-switch').on('click', function() {
|
|
|
- $('#animated-switch').bootstrapSwitch('setAnimated', false);
|
|
|
+ $('#animated-switch').bootstrapSwitch('animate', false);
|
|
|
});
|
|
|
|
|
|
// radio
|
|
@@ -115,6 +115,7 @@ $(function() {
|
|
|
$('.radio1').bootstrapSwitch('toggleRadioState');
|
|
|
});
|
|
|
$('.radio2').on('switch-change', function () {
|
|
|
- $('.radio2').bootstrapSwitch('toggleRadioStateAllowUncheck', true);
|
|
|
+ console.log("ok");
|
|
|
+ $('.radio2').bootstrapSwitch('toggleRadioState', true);
|
|
|
});
|
|
|
});
|