summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-06-30 00:09:05 +0000
committerFatih Acet <acetfatih@gmail.com>2016-06-30 00:09:05 +0000
commit48843c0d85bea07f8c87877e8ba5c3ce1312aafb (patch)
tree7d1eededc43c4bdda8ddcda1e957356da05631f5
parentdbac53aa26e20f6aa9f2e6f9f355a3c983e474e1 (diff)
parent8cdee2bab24bb909fc103bc9d4eab51c73090101 (diff)
downloadgitlab-ce-48843c0d85bea07f8c87877e8ba5c3ce1312aafb.tar.gz
Merge branch '19157-use-shortcuts-is-not-working-on-gitlab-com-help' into 'master'
Fixed 'use shortcuts' button on docs ## What does this MR do? Exposes 'onToggleHelp() to window object through `showHelp()` so a help panel can be toggled globally using `showHelp()`. ## Are there points in the code the reviewer needs to double check? Is this the best implementation? I actually think this is tidier than doing something like `onclick="new Shortcuts().onToggleHelp"` or `$.trigger 'keydown', char: '?'` but let me know. ## Why was this MR needed? Docs UX ## What are the relevant issue numbers? Closes #19157. ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) Closes #19157 See merge request !4979
-rw-r--r--app/assets/javascripts/shortcuts.js.coffee6
-rw-r--r--app/views/help/index.html.haml2
2 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/shortcuts.js.coffee b/app/assets/javascripts/shortcuts.js.coffee
index c03877e9b06..3319a67a79d 100644
--- a/app/assets/javascripts/shortcuts.js.coffee
+++ b/app/assets/javascripts/shortcuts.js.coffee
@@ -9,12 +9,12 @@ class @Shortcuts
onToggleHelp: (e) =>
e.preventDefault()
- @toggleHelp(@enabledHelp)
+ Shortcuts.toggleHelp(@enabledHelp)
- toggleMarkdownPreview: (e) =>
+ toggleMarkdownPreview: (e) ->
$(document).triggerHandler('markdown-preview:toggle', [e])
- toggleHelp: (location) ->
+ @toggleHelp: (location) ->
$modal = $('#modal-shortcuts')
if $modal.length
diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml
index 57bc91ea5a9..57601ae9be0 100644
--- a/app/views/help/index.html.haml
+++ b/app/views/help/index.html.haml
@@ -36,6 +36,6 @@
%ul.well-list
%li= link_to 'See our website for getting help', promo_url + '/getting-help/'
%li= link_to 'Use the search bar on the top of this page', '#', onclick: 'Shortcuts.focusSearch(event)'
- %li= link_to 'Use shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
+ %li= link_to 'Use shortcuts', '#', onclick: 'Shortcuts.toggleHelp()'
%li= link_to 'Get a support subscription', 'https://about.gitlab.com/pricing/'
%li= link_to 'Compare GitLab editions', 'https://about.gitlab.com/features/#compare'