diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-02-24 15:53:39 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-02-24 15:53:39 -0500 |
commit | ccabbaa9b348ed839e4cfb12427671676bc15c8a (patch) | |
tree | 5406b7a938b2a888c480c9fc1b170c6f11ce2205 | |
parent | 7fdc29715adc34acdfe7671f3452a38b93e32392 (diff) | |
download | gitlab-ce-ccabbaa9b348ed839e4cfb12427671676bc15c8a.tar.gz |
Wait until listeners are set before triggering a 'click' eventbugfix/jschatz/sidebar-issues/minimize-on-diff
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js.coffee | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index e6e502cf6b6..40cfa59a229 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -190,6 +190,10 @@ class @MergeRequestTabs shrinkView: -> $gutterIcon = $('.gutter-toggle i') - # Only when sidebar is collapsed - if $gutterIcon.is('.fa-angle-double-right') - $gutterIcon.closest('a').trigger('click') + # Wait until listeners are set + setTimeout( -> + # Only when sidebar is collapsed + if $gutterIcon.is('.fa-angle-double-right') + $gutterIcon.closest('a').trigger('click') + , 0) + |