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

@ -30,4 +30,4 @@ _ready = ->
sweetAlertInitialize()
$(document).ready _ready
$(document).on 'page:load', _ready
$(document).on 'page:load', _ready

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
($ "button[name=qb-all-ask]").trigger 'click'
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"}