Commit dcc5b4183f1227c528a8768712edb1a4a58a432c

Authored by Francisco Júnior
1 parent a0fd2411

comment_paragraph_plugin : add function to close comment side box when ESC key is pressed

plugins/comment_paragraph/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 +});