21 lines
707 B
JavaScript
21 lines
707 B
JavaScript
//= require lib/arrow-on-list-edit
|
|
|
|
$(function() {
|
|
$.pageslide.closeCallback(function(pageslide, item) {
|
|
$("tr").removeClass("active");
|
|
pageslide.find('.preview').cycle('destroy')
|
|
});
|
|
$.pageslide.loadComplete(function(pageslide, item) {
|
|
$("tr").removeClass("active");
|
|
item.closest('tr').addClass('active');
|
|
setSlideshow(pageslide.find('.preview'), item.data());
|
|
if(item.data('id') == 'new') {
|
|
pageslide.find('form').attr('action', '/admin/ad_banners/');
|
|
pageslide.find('form').attr('method', 'post');
|
|
}
|
|
else {
|
|
pageslide.find('form').attr('action', '/admin/ad_banners/' + item.data('id'));
|
|
pageslide.find('form').attr('method', 'put');
|
|
}
|
|
});
|
|
}) |