Commit 96e2cd255c9992c708f49202b88eb7c5f364cef7
1 parent
efd5c28f
Exists in
master
comment_paragraph_plugin : add function to close comment side box when ESC key is pressed
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
public/comment_paragraph_macro.js
@@ -248,3 +248,10 @@ function loadCompleted(paragraph) { | @@ -248,3 +248,10 @@ function loadCompleted(paragraph) { | ||
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | +jQuery(document).keyup(function(e) { | ||
252 | + // on press ESC key... | ||
253 | + if (e.which == 27) { | ||
254 | + // closing side comment box | ||
255 | + side_comment_box_opened = jQuery("div.side-comment").filter("div[style!='display: block;']").css('display', 'none'); | ||
256 | + } | ||
257 | +}); |