Files
osem/app/assets/javascripts/osem-switch.js
2015-06-14 22:28:33 +03:00

15 lines
344 B
JavaScript

$(function () {
$("[class='switch-checkbox']").bootstrapSwitch();
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
var url = $(this).attr('url') + state;
var method = $(this).attr('method');
$.ajax({
url: url,
type: method,
dataType: 'script'
});
});
});