mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Fix:Patched Editor.js to fix firefox issues
This commit is contained in:
parent
cac68fb551
commit
5c49fcf543
1 changed files with 4 additions and 5 deletions
|
@ -75,7 +75,6 @@ function Squire ( doc ) {
|
|||
|
||||
this._events = {};
|
||||
|
||||
this._sel = win.getSelection();
|
||||
this._lastSelection = null;
|
||||
|
||||
// IE loses selection state of iframe on blur, so make sure we
|
||||
|
@ -280,7 +279,7 @@ proto.setSelection = function ( range ) {
|
|||
if ( isIOS ) {
|
||||
this._win.focus();
|
||||
}
|
||||
var sel = this._sel;
|
||||
var sel = this._win.getSelection();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange( range );
|
||||
}
|
||||
|
@ -288,7 +287,7 @@ proto.setSelection = function ( range ) {
|
|||
};
|
||||
|
||||
proto.getSelection = function () {
|
||||
var sel = this._sel,
|
||||
var sel = this._win.getSelection(),
|
||||
selection, startContainer, endContainer;
|
||||
if ( sel.rangeCount ) {
|
||||
selection = sel.getRangeAt( 0 ).cloneRange();
|
||||
|
@ -1982,11 +1981,11 @@ var keyHandlers = {
|
|||
if ( isMac && isGecko && win.getSelection().modify ) {
|
||||
keyHandlers[ 'meta-left' ] = function ( self, event ) {
|
||||
event.preventDefault();
|
||||
self._sel.modify( 'move', 'backward', 'lineboundary' );
|
||||
self._win.getSelection().modify( 'move', 'backward', 'lineboundary' );
|
||||
};
|
||||
keyHandlers[ 'meta-right' ] = function ( self, event ) {
|
||||
event.preventDefault();
|
||||
self._sel.modify( 'move', 'forward', 'lineboundary' );
|
||||
self._win.getSelection().modify( 'move', 'forward', 'lineboundary' );
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue