2013-10-18 10:31:18 +00:00
|
|
|
$(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');
|
|
|
|
if(item.data('id') == 'new') {
|
2013-10-20 22:34:55 +00:00
|
|
|
resetForm();
|
2013-10-18 10:31:18 +00:00
|
|
|
pageslide.find('form').attr('action', '/admin/ad_banners/');
|
|
|
|
pageslide.find('form').attr('method', 'post');
|
|
|
|
}
|
|
|
|
else {
|
2013-10-20 22:34:55 +00:00
|
|
|
setForm(item.data('form'));
|
|
|
|
pageslide.find('form').attr('action', '/admin/ad_banners/' + item.data('id'));
|
2013-10-18 10:31:18 +00:00
|
|
|
pageslide.find('form').attr('method', 'put');
|
|
|
|
}
|
2013-10-20 22:34:55 +00:00
|
|
|
setSlideshow(pageslide.find('.preview'), item.data());
|
2013-10-18 10:31:18 +00:00
|
|
|
});
|
|
|
|
})
|