mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
parent
579cad7ff9
commit
a8fcd55cf4
4 changed files with 17 additions and 7 deletions
|
@ -1158,6 +1158,10 @@ var onKey = function ( event ) {
|
|||
modifiers = '',
|
||||
range = this.getSelection();
|
||||
|
||||
if ( event.defaultPrevented ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !key ) {
|
||||
key = String.fromCharCode( code ).toLowerCase();
|
||||
// Only reliable for letters and numbers
|
||||
|
@ -2292,7 +2296,7 @@ var customEvents = {
|
|||
|
||||
proto.fireEvent = function ( type, event ) {
|
||||
var handlers = this._events[ type ],
|
||||
i, l, obj;
|
||||
l, obj;
|
||||
if ( handlers ) {
|
||||
if ( !event ) {
|
||||
event = {};
|
||||
|
@ -2302,8 +2306,9 @@ proto.fireEvent = function ( type, event ) {
|
|||
}
|
||||
// Clone handlers array, so any handlers added/removed do not affect it.
|
||||
handlers = handlers.slice();
|
||||
for ( i = 0, l = handlers.length; i < l; i += 1 ) {
|
||||
obj = handlers[i];
|
||||
l = handlers.length;
|
||||
while ( l-- ) {
|
||||
obj = handlers[l];
|
||||
try {
|
||||
if ( obj.handleEvent ) {
|
||||
obj.handleEvent( event );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -191,7 +191,7 @@ var customEvents = {
|
|||
|
||||
proto.fireEvent = function ( type, event ) {
|
||||
var handlers = this._events[ type ],
|
||||
i, l, obj;
|
||||
l, obj;
|
||||
if ( handlers ) {
|
||||
if ( !event ) {
|
||||
event = {};
|
||||
|
@ -201,8 +201,9 @@ proto.fireEvent = function ( type, event ) {
|
|||
}
|
||||
// Clone handlers array, so any handlers added/removed do not affect it.
|
||||
handlers = handlers.slice();
|
||||
for ( i = 0, l = handlers.length; i < l; i += 1 ) {
|
||||
obj = handlers[i];
|
||||
l = handlers.length;
|
||||
while ( l-- ) {
|
||||
obj = handlers[l];
|
||||
try {
|
||||
if ( obj.handleEvent ) {
|
||||
obj.handleEvent( event );
|
||||
|
|
|
@ -21,6 +21,10 @@ var onKey = function ( event ) {
|
|||
modifiers = '',
|
||||
range = this.getSelection();
|
||||
|
||||
if ( event.defaultPrevented ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !key ) {
|
||||
key = String.fromCharCode( code ).toLowerCase();
|
||||
// Only reliable for letters and numbers
|
||||
|
|
Loading…
Reference in a new issue