Permalink
Browse files

old IEs range fixes

  • Loading branch information...
1 parent 0769922 commit 4da790b7b93e0c90e89a406f8d0beb38f153bec8 @jerrymf jerrymf committed Jun 21, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 util/range.js
View
@@ -988,7 +988,7 @@ JAK.Range.prototype.isInNode = function(node) {
JAK.Range.prototype.setFromSelection = function() {
if (JAK.Range.OLD_IE) {
this._nSel = this._contextWindow.document.selection;
- this._nRng = this._contextWindow.document.selection.createRange();
+ this._nRng = this._nSel.createRange();
this._resetIERange();
this.getStartEnd();
} else {
@@ -1101,13 +1101,13 @@ JAK.Range.prototype.setStartEnd = function(startContainer, startOffset, endConta
JAK.Range.prototype.show = function() {
if (!this._nSel) {
if (JAK.Range.OLD_IE) {
- this._nSel = this._nRng;
+ this._nSel = this._contextWindow.document.selection;
} else {
this._nSel = this._contextWindow.getSelection();
}
}
if (JAK.Range.OLD_IE) {
- this._nSel.select();
+ this._nRng.select();
} else {
this._nSel.removeAllRanges();
this._nSel.addRange(this._nRng);

0 comments on commit 4da790b

Please sign in to comment.