diff options
author | Phil Hughes <me@iamphill.com> | 2016-04-19 14:32:21 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-04-19 14:32:21 +0100 |
commit | 114d3c9846a7cb7085f881bc856f7fa6d307dc57 (patch) | |
tree | d06cf5a55a6c0eda1096bf617839788595623418 | |
parent | 2011f02b5dc718b39ee7b3de7db4cea2fffafd36 (diff) | |
download | gitlab-ce-edit-link-anchor-stop.tar.gz |
Fixed issue with sidebar edit links toggling anchoredit-link-anchor-stop
This caused an issue with the page scrolling from the bottom to the top. Also stopped the dropdown links doing the same.
-rw-r--r-- | app/assets/javascripts/issuable_context.js.coffee | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/app/assets/javascripts/issuable_context.js.coffee b/app/assets/javascripts/issuable_context.js.coffee index 2f19513a831..9ae0cd06039 100644 --- a/app/assets/javascripts/issuable_context.js.coffee +++ b/app/assets/javascripts/issuable_context.js.coffee @@ -9,21 +9,30 @@ class @IssuableContext $(".issuable-sidebar .inline-update").on "change", ".js-assignee", -> $(this).submit() - $(document).off("click", ".edit-link").on "click",".edit-link", (e) -> - $block = $(@).parents('.block') - $selectbox = $block.find('.selectbox') - if $selectbox.is(':visible') - $selectbox.hide() - $block.find('.value').show() - else - $selectbox.show() - $block.find('.value').hide() - - if $selectbox.is(':visible') - setTimeout (-> - $block.find('.dropdown-menu-toggle').trigger 'click' - ), 0 - + $(document) + .off 'click', '.dropdown-content a' + .on 'click', '.dropdown-content a', (e) -> + e.preventDefault() + + $(document) + .off 'click', '.edit-link' + .on 'click', '.edit-link', (e) -> + e.preventDefault() + + $block = $(@).parents('.block') + $selectbox = $block.find('.selectbox') + if $selectbox.is(':visible') + $selectbox.hide() + $block.find('.value').show() + else + $selectbox.show() + $block.find('.value').hide() + + if $selectbox.is(':visible') + setTimeout -> + $block.find('.dropdown-menu-toggle').trigger 'click' + , 0 + $(".right-sidebar").niceScroll() |