fix sorting in events#index with button functionality and add color/text to switch buttons

This commit is contained in:
Stella 2015-01-21 20:12:57 +02:00
parent b8b3703175
commit fbdec2a58e
5 changed files with 26 additions and 19 deletions

View file

@ -7,6 +7,7 @@
%meta{:content => "", :name => "author"}
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
:javascript
window.liveSettings = {
@ -15,23 +16,6 @@
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"