mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-08 16:00:06 -05:00
Update build with latest changes.
This commit is contained in:
parent
8d178e1a65
commit
0c87def58c
2 changed files with 13 additions and 9 deletions
|
@ -2163,7 +2163,6 @@ function Squire ( doc, config ) {
|
||||||
|
|
||||||
this._events = {};
|
this._events = {};
|
||||||
|
|
||||||
this._sel = win.getSelection();
|
|
||||||
this._lastSelection = null;
|
this._lastSelection = null;
|
||||||
|
|
||||||
// IE loses selection state of iframe on blur, so make sure we
|
// IE loses selection state of iframe on blur, so make sure we
|
||||||
|
@ -2449,17 +2448,23 @@ proto.setSelection = function ( range ) {
|
||||||
if ( isIOS ) {
|
if ( isIOS ) {
|
||||||
this._win.focus();
|
this._win.focus();
|
||||||
}
|
}
|
||||||
var sel = this._sel;
|
var sel = this._getWindowSelection();
|
||||||
sel.removeAllRanges();
|
if ( sel ) {
|
||||||
sel.addRange( range );
|
sel.removeAllRanges();
|
||||||
|
sel.addRange( range );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
proto._getWindowSelection = function () {
|
||||||
|
return this._win.getSelection() || null;
|
||||||
|
};
|
||||||
|
|
||||||
proto.getSelection = function () {
|
proto.getSelection = function () {
|
||||||
var sel = this._sel,
|
var sel = this._getWindowSelection(),
|
||||||
selection, startContainer, endContainer;
|
selection, startContainer, endContainer;
|
||||||
if ( sel.rangeCount ) {
|
if ( sel && sel.rangeCount ) {
|
||||||
selection = sel.getRangeAt( 0 ).cloneRange();
|
selection = sel.getRangeAt( 0 ).cloneRange();
|
||||||
startContainer = selection.startContainer;
|
startContainer = selection.startContainer;
|
||||||
endContainer = selection.endContainer;
|
endContainer = selection.endContainer;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue