From dd20da1bfff2cd5ea43c8c3c6837bd40e5f44f4f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 10 Jan 2013 17:38:37 +0200 Subject: [PATCH] Fix pager loading on every page in application --- app/assets/javascripts/dashboard.js.coffee | 5 +---- app/views/dashboard/index.html.haml | 3 +++ app/views/keys/create.js.haml | 9 --------- app/views/keys/new.js.haml | 11 ----------- 4 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 app/views/keys/create.js.haml delete mode 100644 app/views/keys/new.js.haml diff --git a/app/assets/javascripts/dashboard.js.coffee b/app/assets/javascripts/dashboard.js.coffee index b0ae6bf8..f15d09dd 100644 --- a/app/assets/javascripts/dashboard.js.coffee +++ b/app/assets/javascripts/dashboard.js.coffee @@ -1,7 +1,4 @@ -$ -> - dashboardPage() - -dashboardPage = -> +window.dashboardPage = -> Pager.init 20, true $(".event_filter_link").bind "click", (event) -> event.preventDefault() diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index abbe3101..1a66ba4f 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -7,3 +7,6 @@ - else = render "zero_authorized_projects" + +:javascript + dashboardPage(); diff --git a/app/views/keys/create.js.haml b/app/views/keys/create.js.haml deleted file mode 100644 index 1dccf6fd..00000000 --- a/app/views/keys/create.js.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if @key.valid? - :plain - $("#new_key_dialog").dialog("close"); - $("#keys-table .data").append("#{escape_javascript(render(partial: 'show', locals: {key: @key}))}"); - $("#no_ssh_key_defined").hide(); -- else - :plain - $("#new_key_dialog").empty(); - $("#new_key_dialog").append("#{escape_javascript(render('form'))}"); diff --git a/app/views/keys/new.js.haml b/app/views/keys/new.js.haml deleted file mode 100644 index 86e9db03..00000000 --- a/app/views/keys/new.js.haml +++ /dev/null @@ -1,11 +0,0 @@ -:plain - var new_key_dialog = $("
"); - new_key_dialog.html("#{escape_javascript(render('form'))}"); - $(new_key_dialog).dialog({ - width: 350, - resizable: false, - draggable: false, - title: "Add new public key", - close: function(event, ui) { $("#new_key_dialog").remove();}, - modal: true - });