mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
parent
93f7867214
commit
7330324d92
3 changed files with 9 additions and 9 deletions
|
@ -1573,22 +1573,22 @@ var keyHandlers = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Firefox incorrectly handles Cmd-left/Cmd-right on Mac:
|
// Firefox pre v29 incorrectly handles Cmd-left/Cmd-right on Mac:
|
||||||
// it goes back/forward in history! Override to do the right
|
// it goes back/forward in history! Override to do the right
|
||||||
// thing.
|
// thing.
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=289384
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=289384
|
||||||
if ( isMac && isGecko && win.getSelection().modify ) {
|
if ( isMac && isGecko ) {
|
||||||
keyHandlers[ 'meta-left' ] = function ( self, event ) {
|
keyHandlers[ 'meta-left' ] = function ( self, event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var sel = getWindowSelection( self );
|
var sel = getWindowSelection( self );
|
||||||
if ( sel ) {
|
if ( sel && sel.modify ) {
|
||||||
sel.modify( 'move', 'backward', 'lineboundary' );
|
sel.modify( 'move', 'backward', 'lineboundary' );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
keyHandlers[ 'meta-right' ] = function ( self, event ) {
|
keyHandlers[ 'meta-right' ] = function ( self, event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var sel = getWindowSelection( self );
|
var sel = getWindowSelection( self );
|
||||||
if ( sel ) {
|
if ( sel && sel.modify ) {
|
||||||
sel.modify( 'move', 'forward', 'lineboundary' );
|
sel.modify( 'move', 'forward', 'lineboundary' );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -424,22 +424,22 @@ var keyHandlers = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Firefox incorrectly handles Cmd-left/Cmd-right on Mac:
|
// Firefox pre v29 incorrectly handles Cmd-left/Cmd-right on Mac:
|
||||||
// it goes back/forward in history! Override to do the right
|
// it goes back/forward in history! Override to do the right
|
||||||
// thing.
|
// thing.
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=289384
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=289384
|
||||||
if ( isMac && isGecko && win.getSelection().modify ) {
|
if ( isMac && isGecko ) {
|
||||||
keyHandlers[ 'meta-left' ] = function ( self, event ) {
|
keyHandlers[ 'meta-left' ] = function ( self, event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var sel = getWindowSelection( self );
|
var sel = getWindowSelection( self );
|
||||||
if ( sel ) {
|
if ( sel && sel.modify ) {
|
||||||
sel.modify( 'move', 'backward', 'lineboundary' );
|
sel.modify( 'move', 'backward', 'lineboundary' );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
keyHandlers[ 'meta-right' ] = function ( self, event ) {
|
keyHandlers[ 'meta-right' ] = function ( self, event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var sel = getWindowSelection( self );
|
var sel = getWindowSelection( self );
|
||||||
if ( sel ) {
|
if ( sel && sel.modify ) {
|
||||||
sel.modify( 'move', 'forward', 'lineboundary' );
|
sel.modify( 'move', 'forward', 'lineboundary' );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue