Skip to content

Commit

Permalink
fix(listView): avoiding potential memory leak from assigning properti…
Browse files Browse the repository at this point in the history
…es directly to an element
  • Loading branch information
perrygovier committed Jun 6, 2014
1 parent afdf0ad commit d779346
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/views/listView.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@
this.scrollEl = opts.scrollEl;
this.scrollView = opts.scrollView;
// Get the True Top of the list el http://www.quirksmode.org/js/findpos.html
this.listEl.trueTop = 0;
this.listElTrueTop = 0;
if (this.listEl.offsetParent) {
var obj = this.listEl;
do {
this.listEl.trueTop += obj.offsetTop;
this.listElTrueTop += obj.offsetTop;
obj = obj.offsetParent;
} while (obj);
}
Expand All @@ -203,7 +203,7 @@
var y = e.gesture.center.pageY +
this.scrollView.getValues().top -
(this._currentDrag.elementHeight / 2) -
this.listEl.trueTop;
this.listElTrueTop;
this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, '+y+'px, 0)';
};

Expand Down Expand Up @@ -239,7 +239,7 @@

var scrollY = 0;
var pageY = e.gesture.center.pageY;
var offset = this.listEl.trueTop;
var offset = this.listElTrueTop;

//If we have a scrollView, check scroll boundaries for dragged element and scroll if necessary
if (this.scrollView) {
Expand Down

0 comments on commit d779346

Please sign in to comment.