summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2016-06-28 20:10:06 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2016-06-29 23:15:36 +0100
commit8cdee2bab24bb909fc103bc9d4eab51c73090101 (patch)
treeb54c07607a706d250ffba7407e379cca5dbb0163
parent84113d7e725dcf6f9a3945853475f0cede957fec (diff)
downloadgitlab-ce-8cdee2bab24bb909fc103bc9d4eab51c73090101.tar.gz
Exposed 'onToggleHelp() to window object so showHelp() can be a global function'
Removed from window and used static method
-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'