mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add a function for initing boostrapSwitch outside of $()
This commit is contained in:
parent
dda6587ed3
commit
d703dad496
1 changed files with 9 additions and 3 deletions
|
|
@ -1,7 +1,9 @@
|
|||
$(function () {
|
||||
$("[class='switch-checkbox']").bootstrapSwitch();
|
||||
function checkboxSwitch(selector){
|
||||
$(selector).bootstrapSwitch(
|
||||
|
||||
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
||||
);
|
||||
|
||||
$(selector).on('switchChange.bootstrapSwitch', function(event, state) {
|
||||
var url = $(this).attr('url') + state;
|
||||
var method = $(this).attr('method');
|
||||
|
||||
|
|
@ -11,6 +13,10 @@ $(function () {
|
|||
dataType: 'script'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
checkboxSwitch("[class='switch-checkbox']");
|
||||
|
||||
$("[class='switch-checkbox-schedule']").bootstrapSwitch();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue