add bootstrap-switch for is_highlight

This commit is contained in:
Stella Rouzi 2014-12-13 21:13:19 +02:00 committed by Stella
parent 2dd326c8b9
commit a845dd5d7d
9 changed files with 45 additions and 12 deletions

View file

@ -15,6 +15,23 @@
detectlang: true,
autocollect: true
};
$(document).ready(function() {
$("[class='switch-checkbox']").bootstrapSwitch();
});
$(document).ready(function() {
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
url = "/admin/conference/" + this.name + "/events/" + this.value
$.ajax({
url: url,
type: 'PATCH',
data: { event: { is_highlight: state } },
dataType: "script"
});
});
});
= content_for(:script_head)
=# javascript_include_tag "//cdn.transifex.com/live.js"