Skip to content

Commit

Permalink
refs #68 - fixed undefined parameter and event context
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Kekonius authored and nomego committed Jan 29, 2019
1 parent dfcb1bf commit cddb011
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cosmoz-data-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
this._cache = {};
this._preloadIdx = 0;
this._boundOnTemplatesChange = this._onTemplatesChange.bind(this);
this._onCachePurgeHandler = this._onCachePurge.bind(this);
}

connectedCallback() {
Expand All @@ -252,7 +253,7 @@
this.$.templatesSlot,
this._boundOnTemplatesChange
);
window.addEventListener('cosmoz-cache-purge', this._onCachePurge);
window.addEventListener('cosmoz-cache-purge', this._onCachePurgeHandler);
this.addEventListener('tap', this._onTap);
this.addEventListener('transitionend', this._onTransitionEnd);
}
Expand All @@ -270,7 +271,7 @@

this._cache = {};
this._indexRenderQueue = [];
window.removeEventListener('cosmoz-cache-purge', this._onCachePurge);
window.removeEventListener('cosmoz-cache-purge', this._onCachePurgeHandler);
this.removeEventListener('tap', this._onTap);
this.removeEventListener('transitionend', this._onTransitionEnd);

Expand Down Expand Up @@ -923,8 +924,8 @@
}
}

_onCachePurge(e, detail) {
const ids = detail.ids;
_onCachePurge(e) {
const ids = e.detail.ids;
if (!Array.isArray(ids) || ids.length === 0) {
return this.clearCache();
}
Expand Down

0 comments on commit cddb011

Please sign in to comment.