pressing ctrl/meta + m toggles the question box

This commit is contained in:
ix 2015-01-07 19:58:43 +01:00
parent d8f964bda2
commit 66734193b0
3 changed files with 8 additions and 4 deletions

View File

@ -22,8 +22,12 @@ $(document).on "click", "button[name=qb-all-ask]", ->
btn.button "reset"
$("textarea[name=qb-all-question]").removeAttr "readonly"
# hotkey for accessing this quickly
$(document).on "keydown", (evt) ->
if evt.keyCode == 77 and (evt.ctrlKey or evt.metaKey)
$('button[name=toggle-all-ask]').trigger 'click'
# see GitHub issue #2
($ document).on "keydown", "textarea[name=qb-all-question]", (evt) ->
if evt.keyCode == 13 and evt.ctrlKey
if evt.keyCode == 13 and (evt.ctrlKey or evt.metaKey)
($ "button[name=qb-all-ask]").trigger 'click'

View File

@ -25,7 +25,7 @@
= render "layouts/notifications"
%ul.nav.navbar-nav.navbar-right
%li
.btn.btn-primary.navbar-btn.btn-sm.hidden-xs{"data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"}
.btn.btn-primary.navbar-btn.btn-sm.hidden-xs{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"}
%i.fa.fa-pencil-square-o
%li.dropdown
%a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"}