From a6a50227ebe8fa322526e1dcb497cc494d96e9f8 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 3 Dec 2012 12:47:05 +0800 Subject: [PATCH] new type fixed --- .../javascripts/desktop/journal_pages.js.erb | 28 +++++++++++++++---- app/views/desktop/co_authors/index.html.erb | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/desktop/journal_pages.js.erb b/app/assets/javascripts/desktop/journal_pages.js.erb index 9d76d5b6..b0e52677 100644 --- a/app/assets/javascripts/desktop/journal_pages.js.erb +++ b/app/assets/javascripts/desktop/journal_pages.js.erb @@ -303,10 +303,26 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ // } }) return false; - }) - } - bindHandlers(); + }) + $("a.bt-new-type").click(function(){ + $.ajax({ + url : $(this).attr("href"), + type : "get", + success : function(data){ + var prev_data = $("div[container=true]").html(); + $("div[container=true]").html(data); + o.tinyscrollbar_ext({ + main: '.tinycanvas', + fill: '.s_grid_con' + }) + $(".bt-cancel").click(function(){ + $("div[container=true]").html(prev_data); + }) + } + }) + return false; + }) } - - - }; + bindHandlers(); + } +}; diff --git a/app/views/desktop/co_authors/index.html.erb b/app/views/desktop/co_authors/index.html.erb index 06fe6074..0326d5e4 100644 --- a/app/views/desktop/co_authors/index.html.erb +++ b/app/views/desktop/co_authors/index.html.erb @@ -1,6 +1,6 @@

list all coauthor

<%= link_to "New Co-Author", new_desktop_co_author_path %> -<%= link_to "New Type", desktop_co_author_relations_path %> +<%= link_to "New Type", desktop_co_author_relations_path, :class=>"bt-new-type" %>
Name