diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-01-15 09:43:25 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-01-15 09:43:25 +0300 |
commit | 47f0a8dbddc5e2cf86cf4b92b9c7c2fca6d97539 (patch) | |
tree | e2e9d4e25c28edd2b138323378692f970b4aab7d | |
parent | 2c053c93b2ab6f4a42822a8db537e228463e8129 (diff) | |
parent | 8bc65f6d4bc665a1bde9ae2863eb884050acff1d (diff) |
Merge branch 'fix-scroll-issue' into 'master'
Fix scroll issue
Fixes #1886
See merge request !1396
-rw-r--r-- | app/assets/javascripts/application.js.coffee | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 4cda8b75d8e..6d038f772e9 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -109,9 +109,19 @@ window.unbindEvents = -> $(document).unbind('scroll') $(document).off('scroll') +window.shiftWindow = -> + scrollBy 0, -50 + document.addEventListener("page:fetch", unbindEvents) +# Scroll the window to avoid the topnav bar +# https://github.com/twitter/bootstrap/issues/1768 +if location.hash + setTimeout shiftWindow, 1 +window.addEventListener "hashchange", shiftWindow + $ -> + # Click a .one_click_select field, select the contents $(".one_click_select").on 'click', -> $(@).select() |