2012-04-18 07:26:59 +00:00
|
|
|
$('<%= escape_javascript(content_tag(:li,link_to(@ad_banner.title,"##{@ad_banner.title}",:data=>{:toggle=>"tab"}))) %>').insertBefore("#new_ad_banner_tab_but");
|
2012-05-16 08:42:43 +00:00
|
|
|
$('<%= escape_javascript(render(:partial => "ad_banner_tab",:locals => {:ad_banner_tab => @ad_banner})) %>').insertAfter($("#ad_banner-tab-content").children(".tab-pane").last());
|
2012-04-18 07:26:59 +00:00
|
|
|
|
|
|
|
$('.modal').modal('hide');
|
2012-05-16 08:42:43 +00:00
|
|
|
$("#ad_banner-modal-info").empty();
|
|
|
|
$("#new-a-banner form").each(function(){this.reset();});
|
|
|
|
|
2012-04-18 08:24:17 +00:00
|
|
|
$('#new-a-banner').unbind();
|
2012-04-18 07:26:59 +00:00
|
|
|
$('#post-body-content').find(".nav.nav-tabs").children('li.active').removeClass("active");
|
2012-05-16 08:42:43 +00:00
|
|
|
$("#ad_banner-tab-content").children(".tab-pane").removeClass("active");
|
2012-04-18 07:26:59 +00:00
|
|
|
$('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active");
|
2012-05-16 08:42:43 +00:00
|
|
|
$("#ad_banner-tab-content").children(".tab-pane").last().addClass("active");
|
|
|
|
|
2013-01-02 09:51:53 +00:00
|
|
|
<% if params[:action] && params[:action] =='create'%>
|
|
|
|
var trigger = $("#ad_banner-tab-content").children(".tab-pane").last().find(".preview_trigger");
|
|
|
|
new_url = trigger.attr("href").replace(/\/admin\/ad_banners\/.*\/preview/gi,"/admin/ad_banners/<%= @ad_banner.id %>/preview");
|
|
|
|
trigger.attr("href",new_url);
|
|
|
|
<% end %>
|