0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Register for events on capture rather than bubble phase.

Allows "load" events to be triggered for images in the document.
This commit is contained in:
Neil Jenkins 2014-11-18 12:02:36 +07:00
parent 73c4146e27
commit 3296e7576e
3 changed files with 5 additions and 5 deletions

View file

@ -1243,7 +1243,7 @@ proto.destroy = function () {
win.removeEventListener( 'blur', this, false );
for ( type in events ) {
if ( !customEvents[ type ] ) {
doc.removeEventListener( type, this, false );
doc.removeEventListener( type, this, true );
}
}
var l = instances.length;
@ -1270,7 +1270,7 @@ proto.addEventListener = function ( type, fn ) {
if ( !handlers ) {
handlers = this._events[ type ] = [];
if ( !customEvents[ type ] ) {
this._doc.addEventListener( type, this, false );
this._doc.addEventListener( type, this, true );
}
}
handlers.push( fn );

File diff suppressed because one or more lines are too long

View file

@ -158,7 +158,7 @@ proto.destroy = function () {
win.removeEventListener( 'blur', this, false );
for ( type in events ) {
if ( !customEvents[ type ] ) {
doc.removeEventListener( type, this, false );
doc.removeEventListener( type, this, true );
}
}
var l = instances.length;
@ -185,7 +185,7 @@ proto.addEventListener = function ( type, fn ) {
if ( !handlers ) {
handlers = this._events[ type ] = [];
if ( !customEvents[ type ] ) {
this._doc.addEventListener( type, this, false );
this._doc.addEventListener( type, this, true );
}
}
handlers.push( fn );