This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/admin/ad_banners/new_created_node.js.erb

18 lines
1.1 KiB
Plaintext

$('<%= escape_javascript(content_tag(:li,link_to(@ad_banner.title,"##{@ad_banner.title}",:data=>{:toggle=>"tab"}))) %>').insertBefore("#new_ad_banner_tab_but");
$('<%= escape_javascript(render(:partial => "ad_banner_tab",:locals => {:ad_banner_tab => @ad_banner})) %>').insertAfter($("#ad_banner-tab-content").children(".tab-pane").last());
$('.modal').modal('hide');
$("#ad_banner-modal-info").empty();
$("#new-a-banner form").each(function(){this.reset();});
$('#new-a-banner').unbind();
$('#post-body-content').find(".nav.nav-tabs").children('li.active').removeClass("active");
$("#ad_banner-tab-content").children(".tab-pane").removeClass("active");
$('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active");
$("#ad_banner-tab-content").children(".tab-pane").last().addClass("active");
<% 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 %>