From a1d09190e3311cfe7744e9792a4c69822ff84b39 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 25 Mar 2015 21:45:01 -0700 Subject: [PATCH] Prevent unnecessary doubling of js events on import pages and user calendar --- CHANGELOG | 1 + app/views/import/bitbucket/status.html.haml | 3 +-- app/views/import/github/status.html.haml | 3 +-- app/views/import/gitlab/status.html.haml | 3 +-- app/views/import/gitorious/status.html.haml | 3 +-- app/views/projects/issues/_issue_context.html.haml | 3 +-- .../projects/merge_requests/show/_context.html.haml | 5 +---- app/views/projects/new.html.haml | 11 +++++------ app/views/users/show.html.haml | 3 +-- 9 files changed, 13 insertions(+), 22 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f9bd0940a71..d16f20266cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -42,6 +42,7 @@ v 7.10.0 (unreleased) - Send EmailsOnPush email when branch or tag is created or deleted. - Faster merge request processing for large repository - Prevent doubling AJAX request with each commit visit via Turbolink + - Prevent unnecessary doubling of js events on import pages and user calendar v 7.9.0 - Add HipChat integration documentation (Stan Hu) diff --git a/app/views/import/bitbucket/status.html.haml b/app/views/import/bitbucket/status.html.haml index 9da3c920c62..4e49bbbc7fa 100644 --- a/app/views/import/bitbucket/status.html.haml +++ b/app/views/import/bitbucket/status.html.haml @@ -42,5 +42,4 @@ = button_tag "Import", class: "btn js-add-to-import" :coffeescript - $ -> - new ImporterStatus("#{jobs_import_bitbucket_path}", "#{import_bitbucket_path}") + new ImporterStatus("#{jobs_import_bitbucket_path}", "#{import_bitbucket_path}") diff --git a/app/views/import/github/status.html.haml b/app/views/import/github/status.html.haml index 9c4d91013ec..f0bc3e6b1ac 100644 --- a/app/views/import/github/status.html.haml +++ b/app/views/import/github/status.html.haml @@ -42,5 +42,4 @@ = button_tag "Import", class: "btn js-add-to-import" :coffeescript - $ -> - new ImporterStatus("#{jobs_import_github_path}", "#{import_github_path}") + new ImporterStatus("#{jobs_import_github_path}", "#{import_github_path}") diff --git a/app/views/import/gitlab/status.html.haml b/app/views/import/gitlab/status.html.haml index e809643d8d4..33b0a21acf3 100644 --- a/app/views/import/gitlab/status.html.haml +++ b/app/views/import/gitlab/status.html.haml @@ -42,5 +42,4 @@ = button_tag "Import", class: "btn js-add-to-import" :coffeescript - $ -> - new ImporterStatus("#{jobs_import_gitlab_path}", "#{import_gitlab_path}") + new ImporterStatus("#{jobs_import_gitlab_path}", "#{import_gitlab_path}") diff --git a/app/views/import/gitorious/status.html.haml b/app/views/import/gitorious/status.html.haml index 645241a6c69..78c5e957be0 100644 --- a/app/views/import/gitorious/status.html.haml +++ b/app/views/import/gitorious/status.html.haml @@ -42,5 +42,4 @@ = button_tag "Import", class: "btn js-add-to-import" :coffeescript - $ -> - new ImporterStatus("#{jobs_import_gitorious_path}", "#{import_gitorious_path}") + new ImporterStatus("#{jobs_import_gitorious_path}", "#{import_gitorious_path}") diff --git a/app/views/projects/issues/_issue_context.html.haml b/app/views/projects/issues/_issue_context.html.haml index 91fe0b68371..c3d6dc2e50b 100644 --- a/app/views/projects/issues/_issue_context.html.haml +++ b/app/views/projects/issues/_issue_context.html.haml @@ -43,7 +43,6 @@ You're receiving notifications because you're subscribed to this thread. :coffeescript - $ -> - new Subscription("#{toggle_subscription_namespace_project_issue_path(@issue.project.namespace, @project, @issue)}") + new Subscription("#{toggle_subscription_namespace_project_issue_path(@issue.project.namespace, @project, @issue)}") diff --git a/app/views/projects/merge_requests/show/_context.html.haml b/app/views/projects/merge_requests/show/_context.html.haml index 14ad89a2000..80e5c223d60 100644 --- a/app/views/projects/merge_requests/show/_context.html.haml +++ b/app/views/projects/merge_requests/show/_context.html.haml @@ -45,7 +45,4 @@ You're receiving notifications because you're subscribed to this thread. :coffeescript - $ -> - new Subscription("#{toggle_subscription_namespace_project_merge_request_path(@merge_request.project.namespace, @project, @merge_request)}") - - \ No newline at end of file + new Subscription("#{toggle_subscription_namespace_project_merge_request_path(@merge_request.project.namespace, @project, @merge_request)}") diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 9687c8ad87c..42af2f32239 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -109,9 +109,8 @@ %p Please wait a moment, this page will automatically refresh when ready. :coffeescript - $ -> - $('.how_to_import_link').bind 'click', (e) -> - e.preventDefault() - import_modal = $(this).next(".modal").show() - $('.modal-header .close').bind 'click', -> - $(".modal").hide() + $('.how_to_import_link').bind 'click', (e) -> + e.preventDefault() + import_modal = $(this).next(".modal").show() + $('.modal-header .close').bind 'click', -> + $(".modal").hide() diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 0653fb871ae..5e1d65e2ed8 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -47,5 +47,4 @@ = render 'projects' :coffeescript - $ -> - $(".user-calendar").load("#{user_calendar_path}") + $(".user-calendar").load("#{user_calendar_path}")