fix drop event on last char

This commit is contained in:
John McLear 2016-01-17 15:11:54 +00:00
parent 855bd270bd
commit f9937343c7
1 changed files with 4 additions and 3 deletions

View File

@ -4976,7 +4976,6 @@ function Ace2Inner(){
$(document).on("keypress", handleKeyEvent); $(document).on("keypress", handleKeyEvent);
$(document).on("keyup", handleKeyEvent); $(document).on("keyup", handleKeyEvent);
$(document).on("click", handleClick); $(document).on("click", handleClick);
// Disabled: https://github.com/ether/etherpad-lite/issues/2546 // Disabled: https://github.com/ether/etherpad-lite/issues/2546
// Will break OL re-numbering: https://github.com/ether/etherpad-lite/pull/2533 // Will break OL re-numbering: https://github.com/ether/etherpad-lite/pull/2533
// $(document).on("cut", handleCut); // $(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"){ if(e.target.a || e.target.localName === "a"){
e.preventDefault(); e.preventDefault();
} }
// Call drop hook // Call drop hook
hooks.callAll('aceDrop', { hooks.callAll('aceDrop', {
editorInfo: editorInfo, editorInfo: editorInfo,