Skip to content

Commit

Permalink
Event creation, of course, is totally not cross-browser compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Dec 16, 2013
1 parent 8eb0f19 commit 907783a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions imp/js/ckeditor/pasteattachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ CKEDITOR.plugins.add('pasteattachment', {

function fireEventInParent(type)
{
var evt = document.createEvent('DragEvent');
evt.initEvent(type, true, true);
var evt;

try {
evt = new CustomEvent(type, { bubbles: true, cancelable: true });
} catch (ex) {
evt = document.createEvent('DragEvent');
evt.initEvent(type, true, true);
}
editor.getThemeSpace('contents').$.dispatchEvent(evt);
};

Expand Down

0 comments on commit 907783a

Please sign in to comment.