Skip to content

Commit d779346

Browse files
committed
fix(listView): avoiding potential memory leak from assigning properties directly to an element
1 parent afdf0ad commit d779346

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

js/views/listView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@
187187
this.scrollEl = opts.scrollEl;
188188
this.scrollView = opts.scrollView;
189189
// Get the True Top of the list el http://www.quirksmode.org/js/findpos.html
190-
this.listEl.trueTop = 0;
190+
this.listElTrueTop = 0;
191191
if (this.listEl.offsetParent) {
192192
var obj = this.listEl;
193193
do {
194-
this.listEl.trueTop += obj.offsetTop;
194+
this.listElTrueTop += obj.offsetTop;
195195
obj = obj.offsetParent;
196196
} while (obj);
197197
}
@@ -203,7 +203,7 @@
203203
var y = e.gesture.center.pageY +
204204
this.scrollView.getValues().top -
205205
(this._currentDrag.elementHeight / 2) -
206-
this.listEl.trueTop;
206+
this.listElTrueTop;
207207
this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, '+y+'px, 0)';
208208
};
209209

@@ -239,7 +239,7 @@
239239

240240
var scrollY = 0;
241241
var pageY = e.gesture.center.pageY;
242-
var offset = this.listEl.trueTop;
242+
var offset = this.listElTrueTop;
243243

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

0 commit comments

Comments
 (0)