From f9937343c795ce56485dfe969a11f333786f89e5 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 17 Jan 2016 15:11:54 +0000 Subject: [PATCH] fix drop event on last char --- src/static/js/ace2_inner.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 0cfdec3fa..5b7b48a0e 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -4976,7 +4976,6 @@ function Ace2Inner(){ $(document).on("keypress", handleKeyEvent); $(document).on("keyup", handleKeyEvent); $(document).on("click", handleClick); - // Disabled: https://github.com/ether/etherpad-lite/issues/2546 // Will break OL re-numbering: https://github.com/ether/etherpad-lite/pull/2533 // $(document).on("cut", handleCut); @@ -5006,11 +5005,13 @@ function Ace2Inner(){ }); }) - $(root).on("drop", function(e){ + // We reference document here, this is because if we don't this will expose a bug + // in Google Chrome. This bug will cause the last character on the last line to + // not fire an event when dropped into.. + $(document).on("drop", function(e){ if(e.target.a || e.target.localName === "a"){ e.preventDefault(); } - // Call drop hook hooks.callAll('aceDrop', { editorInfo: editorInfo,