Commit 6e550af1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show shotcut dialog on ?

parent 0f84833c
...@@ -67,6 +67,9 @@ $ -> ...@@ -67,6 +67,9 @@ $ ->
$('.appear-data').fadeIn() $('.appear-data').fadeIn()
e.preventDefault() e.preventDefault()
$('body').keydown (e) ->
if e.which is 191
new Shortcuts()
# Initialize chosen selects # Initialize chosen selects
$('select.chosen').chosen() $('select.chosen').chosen()
......
class Shortcuts
constructor: ->
if $('#modal-shortcuts').length > 0
$('#modal-shortcuts').modal('show')
else
$.ajax(
url: '/help/shortcuts',
dataType: "script"
)
@Shortcuts = Shortcuts
...@@ -12,4 +12,7 @@ class HelpController < ApplicationController ...@@ -12,4 +12,7 @@ class HelpController < ApplicationController
not_found! not_found!
end end
end end
def shortcuts
end
end end
#modal-shortcuts.modal.hide
.modal-header
%a.close{href: "#"} ×
%h3 Keyboard Shortcuts
.modal-body
%h5 Global Shortcuts
%p
%span.label.label-inverse s
&ndash;
Focus Search
%p
%span.label.label-inverse ?
&ndash;
Show this dialog
:plain
$("body").append("#{escape_javascript(render('shortcuts'))}");
$("#modal-shortcuts").modal();
...@@ -38,4 +38,3 @@ ...@@ -38,4 +38,3 @@
%li %li
= link_to current_user, class: "profile-pic", id: 'profile-pic' do = link_to current_user, class: "profile-pic", id: 'profile-pic' do
= image_tag gravatar_icon(current_user.email, 26) = image_tag gravatar_icon(current_user.email, 26)
...@@ -38,6 +38,7 @@ Gitlab::Application.routes.draw do ...@@ -38,6 +38,7 @@ Gitlab::Application.routes.draw do
get 'help/system_hooks' => 'help#system_hooks' get 'help/system_hooks' => 'help#system_hooks'
get 'help/web_hooks' => 'help#web_hooks' get 'help/web_hooks' => 'help#web_hooks'
get 'help/workflow' => 'help#workflow' get 'help/workflow' => 'help#workflow'
get 'help/shortcuts'
# #
# Global snippets # Global snippets
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment