Skip to content
Permalink
Browse files

Use FF hack also for internal D&D.

  • Loading branch information...
pjasiun authored and Reinmar committed Sep 10, 2014
1 parent 8969f97 commit 80b01f5f61cfafe29fedda40a3949c0c751aa5bc
Showing with 9 additions and 17 deletions.
  1. +9 −17 plugins/clipboard/plugin.js
@@ -314,6 +314,14 @@
data.dataValue = '';
}

// Because of FF bug we need to use this hack, otherwise cursor is hidden
// or it is not possible to move it (#12420).
if ( CKEDITOR.env.gecko && data.method == 'drop' ) {
editor.once( 'afterPaste', function() {
editor.toolbox.focus();
} );
}

return editor.fire( 'paste', data );
}

@@ -1389,6 +1397,7 @@
dropRange = editor.createRange();
dropRange.moveToBookmark( dropBookmark );
dropRange.select();

firePasteEvents( editor, { dataTransfer: dataTransfer, method: 'drop' }, 1 );

editor.fire( 'unlockSnapshot' );
@@ -1399,11 +1408,6 @@
function crossEditorDrop( dragRange, dropRange, dataTransfer ) {
var i;

// Because of FF bug we need to use this hack, otherwise cursor is hidden.
if ( CKEDITOR.env.gecko ) {
fixGeckoDisappearingCursor( editor );
}

// Paste event should be fired before delete contents because otherwise
// Chrome have a problem with drop range (Chrome split the drop
// range container so the offset is bigger then container length).
@@ -1421,24 +1425,12 @@

// Drop from external source.
function externalDrop( dropRange, dataTransfer ) {
// Because of FF bug we need to use this hack, otherwise cursor is hidden.
if ( CKEDITOR.env.gecko ) {
fixGeckoDisappearingCursor( editor );
}

// Paste content into the drop position.
dropRange.select();

firePasteEvents( editor, { dataTransfer: dataTransfer, method: 'drop' }, 1 );
}

// Fix for Gecko bug with disappearing cursor.
function fixGeckoDisappearingCursor() {
editor.once( 'afterPaste', function() {
editor.toolbox.focus();
} );
}

// Fire drag/drop events (dragstart, dragend, drop).
function fireDragEvent( name, evt, dataTransfer, dragRange, dropRange ) {
var eventData = {

0 comments on commit 80b01f5

Please sign in to comment.
You can’t perform that action at this time.