From 67ba2389a2adb766a1d43664241ab7341c25f565 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 18 Apr 2012 16:24:17 +0800 Subject: [PATCH] fix js --- .../ad_banners/_modal_ad_banner_form.html.erb | 14 ++++++-------- app/views/admin/ad_banners/index.html.erb | 2 +- app/views/admin/ad_banners/new_created_node.js.erb | 1 + 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb index 36ebc4a37..235e7e157 100644 --- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb +++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb @@ -36,17 +36,15 @@ <% end %> diff --git a/app/views/admin/ad_banners/index.html.erb b/app/views/admin/ad_banners/index.html.erb index 4b7dfef26..8307885ab 100644 --- a/app/views/admin/ad_banners/index.html.erb +++ b/app/views/admin/ad_banners/index.html.erb @@ -12,7 +12,7 @@ <% @ad_banners.each do |ab| %> <%= content_tag :li,link_to(ab.title,"##{ab.title}",:data=>{:toggle=>"tab"}),:class => (ab == @active ? 'active' : nil ) %> <% end -%> - <%= content_tag :li,link_to('New',"#new-a-banner",:data=>{:toggle=>"tab"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %> + <%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"tab"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %> diff --git a/app/views/admin/ad_banners/new_created_node.js.erb b/app/views/admin/ad_banners/new_created_node.js.erb index 140be0b44..86970e6a3 100644 --- a/app/views/admin/ad_banners/new_created_node.js.erb +++ b/app/views/admin/ad_banners/new_created_node.js.erb @@ -2,6 +2,7 @@ $('<%= escape_javascript(content_tag(:li,link_to(@ad_banner.title,"##{@ad_banner $('<%= escape_javascript(render(:partial => "ad_banner_tab",:locals => {:ad_banner_tab => @ad_banner})) %>').insertBefore($("#new-a-banner")); $('.modal').modal('hide'); +$('#new-a-banner').unbind(); $('#post-body-content').find(".nav.nav-tabs").children('li.active').removeClass("active"); $('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active");