mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 05:34:04 +00:00
Rework bootstrapSwitch
This commit is contained in:
parent
a35f98b1a3
commit
53f0606ac1
4 changed files with 89 additions and 32 deletions
|
|
@ -1,16 +1,14 @@
|
|||
$(function () {
|
||||
$(document).ready(function() {
|
||||
$("[class='switch-checkbox']").bootstrapSwitch();
|
||||
$("[class='switch-checkbox']").bootstrapSwitch();
|
||||
|
||||
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
||||
url = "/admin/conference/" + this.name + "/events/" + this.value
|
||||
$('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: 'PATCH',
|
||||
data: { event: { is_highlight: state } },
|
||||
dataType: 'script'
|
||||
});
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: method,
|
||||
dataType: 'script'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue