venue_management/app/assets/javascripts/venue_management_sets.js

29 lines
793 B
JavaScript

$(function() {
$('a[data-toggle="tab"]').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
$.pageslide.closeCallback(function(pageslide, item) {
$('.filter-item').removeClass("active");
});
$.pageslide.loadComplete(function(pageslide, item) {
$('.filter-item').removeClass("active");
item.closest('li').addClass('active');
if(item.data('id') == 'new') {
resetForm();
pageslide.find('form:eq(0)').attr('action', window.location.pathname);
pageslide.find('form:eq(0)').attr('method', 'post');
}else {
setForm(item.data('form'));
pageslide.find('form:eq(0)').attr('action', window.location.pathname + '/' + item.data('id'));
pageslide.find('form:eq(0)').attr('method', 'put');
}
});
})