summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-01 01:33:03 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-01 01:33:03 +0000
commitc14c03a88f6c9a1054cf0e7dc2067d47cae6710a (patch)
treeb1882669f314f85aed1391504c871e04aa97fd08
parentdc3b4321ff6ed08b41a9155b85b12df0145df077 (diff)
parent085f12288d92f915f74f2aa85ea21bfb905f27b2 (diff)
downloadgitlab-ce-c14c03a88f6c9a1054cf0e7dc2067d47cae6710a.tar.gz
Merge branch 'rs-issue-1340' into 'master'
Unbind task item checkbox events and then rebind them Fixes #1340 This issue was caused by this line: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/projects/issues/update.js.haml#L17 `new Issue()` gets called on every JS-based issue update, and all the binds in the constructor get re-applied without first unbinding the existing ones. Right now my fix is *only* for the checkbox events, and I suspect there are similar issues still present for other events. See merge request !478
-rw-r--r--app/assets/javascripts/issue.js.coffee8
-rw-r--r--app/assets/javascripts/merge_request.js.coffee8
2 files changed, 4 insertions, 12 deletions
diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee
index bf71c144eaf..0aaa62d2b82 100644
--- a/app/assets/javascripts/issue.js.coffee
+++ b/app/assets/javascripts/issue.js.coffee
@@ -9,12 +9,8 @@ class @Issue
if $("a.btn-close").length
$("li.task-list-item input:checkbox").prop("disabled", false)
- $(".task-list-item input:checkbox").on(
- "click"
- null
- "issue"
- updateTaskState
- )
+ $('.task-list-item input:checkbox').off('change')
+ $('.task-list-item input:checkbox').change('issue', updateTaskState)
$('.issue-details').waitForImages ->
$('.issuable-affix').affix offset:
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index 6127d2bb480..2cbe03b986a 100644
--- a/app/assets/javascripts/merge_request.js.coffee
+++ b/app/assets/javascripts/merge_request.js.coffee
@@ -81,12 +81,8 @@ class @MergeRequest
this.$('.remove_source_branch_in_progress').hide()
this.$('.remove_source_branch_widget.failed').show()
- $(".task-list-item input:checkbox").on(
- "click"
- null
- "merge_request"
- updateTaskState
- )
+ $('.task-list-item input:checkbox').off('change')
+ $('.task-list-item input:checkbox').change('merge_request', updateTaskState)
activateTab: (action) ->
this.$('.merge-request-tabs li').removeClass 'active'