Skip to content

Commit

Permalink
Update build with latest changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilj committed Oct 13, 2015
1 parent 8d178e1 commit 0c87def
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
17 changes: 11 additions & 6 deletions build/squire-raw.js
Expand Up @@ -2163,7 +2163,6 @@ function Squire ( doc, config ) {

this._events = {};

this._sel = win.getSelection();
this._lastSelection = null;

// IE loses selection state of iframe on blur, so make sure we
Expand Down Expand Up @@ -2449,17 +2448,23 @@ proto.setSelection = function ( range ) {
if ( isIOS ) {
this._win.focus();
}
var sel = this._sel;
sel.removeAllRanges();
sel.addRange( range );
var sel = this._getWindowSelection();
if ( sel ) {
sel.removeAllRanges();
sel.addRange( range );
}
}
return this;
};

proto._getWindowSelection = function () {
return this._win.getSelection() || null;
};

proto.getSelection = function () {
var sel = this._sel,
var sel = this._getWindowSelection(),
selection, startContainer, endContainer;
if ( sel.rangeCount ) {
if ( sel && sel.rangeCount ) {
selection = sel.getRangeAt( 0 ).cloneRange();
startContainer = selection.startContainer;
endContainer = selection.endContainer;
Expand Down

0 comments on commit 0c87def

Please sign in to comment.