mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-23 07:43:52 -05:00
Update Editor.js
This commit is contained in:
parent
2c9b606b0f
commit
299d45bbb9
1 changed files with 7 additions and 6 deletions
|
@ -57,12 +57,9 @@ function Squire ( doc, config ) {
|
||||||
this.addEventListener( 'mouseup', this._updatePathOnEvent );
|
this.addEventListener( 'mouseup', this._updatePathOnEvent );
|
||||||
|
|
||||||
// Prevents redirecting dropped files, event can then be captured with editor.addEventListener in the host document
|
// Prevents redirecting dropped files, event can then be captured with editor.addEventListener in the host document
|
||||||
this.addEventListener('dragover', function(event) {
|
this.addEventListener('dragover', this.addEventListener('dragover', this.preventDefaultEvent);
|
||||||
event.preventDefault();
|
this.addEventListener('drop', this.preventDefaultEvent);
|
||||||
});
|
this.addEventListener('drop', this.preventDefaultEvent);
|
||||||
this.addEventListener('drop', function(){
|
|
||||||
event.preventDefault();
|
|
||||||
});
|
|
||||||
|
|
||||||
win.addEventListener( 'focus', this, false );
|
win.addEventListener( 'focus', this, false );
|
||||||
win.addEventListener( 'blur', this, false );
|
win.addEventListener( 'blur', this, false );
|
||||||
|
@ -186,6 +183,10 @@ proto.getDocument = function () {
|
||||||
return this._doc;
|
return this._doc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
proto.preventDefaultEvent = function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
};
|
||||||
|
|
||||||
// --- Events ---
|
// --- Events ---
|
||||||
|
|
||||||
// Subscribing to these events won't automatically add a listener to the
|
// Subscribing to these events won't automatically add a listener to the
|
||||||
|
|
Loading…
Reference in a new issue