assets/javascripts/materialize/pushpin.js in materialize-sass-1.0.0 vs assets/javascripts/materialize/pushpin.js in materialize-sass-1.0.0.1
- old
+ new
@@ -60,14 +60,17 @@
* Teardown component
*/
value: function destroy() {
this.el.style.top = null;
this._removePinClasses();
- this._removeEventHandlers();
// Remove pushpin Inst
var index = Pushpin._pushpins.indexOf(this);
Pushpin._pushpins.splice(index, 1);
+ if (Pushpin._pushpins.length === 0) {
+ this._removeEventHandlers();
+ }
+ this.el.M_Pushpin = undefined;
}
}, {
key: '_setupEventHandlers',
value: function _setupEventHandlers() {
document.addEventListener('scroll', Pushpin._updateElements);