Permalink
Browse files

Show shotcut dialog on ?

  • Loading branch information...
1 parent 0f84833 commit 6e550af150958d0c88bf21f206c2309dc0b5c78d @dzaporozhets dzaporozhets committed Jun 30, 2013
@@ -67,6 +67,9 @@ $ ->
$('.appear-data').fadeIn()
e.preventDefault()
+ $('body').keydown (e) ->
+ if e.which is 191
+ new Shortcuts()
# Initialize chosen selects
$('select.chosen').chosen()
@@ -0,0 +1,11 @@
+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 @@ def api
not_found!
end
end
+
+ def shortcuts
+ end
end
@@ -0,0 +1,14 @@
+#modal-shortcuts.modal.hide
+ .modal-header
+ %a.close{href: "#"} ×
+ %h3 Keyboard Shortcuts
+ .modal-body
+ %h5 Global Shortcuts
+ %p
+ %span.label.label-inverse s
+ –
+ Focus Search
+ %p
+ %span.label.label-inverse ?
+ –
+ Show this dialog
@@ -0,0 +1,3 @@
+:plain
+ $("body").append("#{escape_javascript(render('shortcuts'))}");
+ $("#modal-shortcuts").modal();
@@ -38,4 +38,3 @@
%li
= link_to current_user, class: "profile-pic", id: 'profile-pic' do
= image_tag gravatar_icon(current_user.email, 26)
-
View
@@ -38,6 +38,7 @@
get 'help/system_hooks' => 'help#system_hooks'
get 'help/web_hooks' => 'help#web_hooks'
get 'help/workflow' => 'help#workflow'
+ get 'help/shortcuts'
#
# Global snippets

0 comments on commit 6e550af

Please sign in to comment.