index.min.js 2.8 KB

1
  1. $(function(){$("#mySwitch").on("switch-change",function(e,t){var n=$(t.el),r=t.value;console.log(e,n,r)});$("#btn-size-regular-switch").on("click",function(){$("#dimension-switch").bootstrapSwitch("setSizeClass","")});$("#btn-size-mini-switch").on("click",function(){$("#dimension-switch").bootstrapSwitch("setSizeClass","switch-mini")});$("#btn-size-small-switch").on("click",function(){$("#dimension-switch").bootstrapSwitch("setSizeClass","switch-small")});$("#btn-size-large-switch").on("click",function(){$("#dimension-switch").bootstrapSwitch("setSizeClass","switch-large")});$("#toggle-state-switch-button").on("click",function(){$("#toggle-state-switch").bootstrapSwitch("toggleState")});$("#toggle-state-switch-button-on").on("click",function(){$("#toggle-state-switch").bootstrapSwitch("setState",!0)});$("#toggle-state-switch-button-off").on("click",function(){$("#toggle-state-switch").bootstrapSwitch("setState",!1)});$("#toggle-state-switch-button-status").on("click",function(){alert($("#toggle-state-switch").bootstrapSwitch("status"))});$("#btn-destroy-switch").on("click",function(){$("#destroy-switch").bootstrapSwitch("destroy");$(this).remove()});$("#btn-create").on("click",function(){$("#create-switch").wrap('<div class="make-switch" />').parent().bootstrapSwitch();$(this).remove()});$("#btn-is-active-switch").on("click",function(){alert($("#disable-switch").bootstrapSwitch("isActive"))});$("#btn-toggle-activation-switch").on("click",function(){$("#disable-switch").bootstrapSwitch("toggleActivation")});$("#btn-disable-switch").on("click",function(){$("#disable-switch").bootstrapSwitch("setActive",!1)});$("#btn-activate-switch").on("click",function(){$("#disable-switch").bootstrapSwitch("setActive",!0)});$("#btn-label-on-switch").on("click",function(){$("#label-switch").bootstrapSwitch("setOnLabel","I")});$("#btn-label-off-switch").on("click",function(){$("#label-switch").bootstrapSwitch("setOffLabel","O")});$("#label-toggle-switch").on("click",function(e,t){$(".label-toggle-switch").bootstrapSwitch("toggleState")});$(".label-toggle-switch").on("switch-change",function(e,t){alert(t.value)});$("#label2-toggle-switch").on("switch-change",function(e,t){alert(t.value)});$("#btn-color-on-switch").on("click",function(){$("#change-color-switch").bootstrapSwitch("setOnClass","success")});$("#btn-color-off-switch").on("click",function(){$("#change-color-switch").bootstrapSwitch("setOffClass","danger")});$("#btn-animate-switch").on("click",function(){$("#animated-switch").bootstrapSwitch("setAnimated",!0)});$("#btn-dont-animate-switch").on("click",function(){$("#animated-switch").bootstrapSwitch("setAnimated",!1)});$(".radio1").on("switch-change",function(){$(".radio1").bootstrapSwitch("toggleRadioState")});$(".radio2").on("switch-change",function(){$(".radio2").bootstrapSwitch("toggleRadioStateAllowUncheck",!0)})});