Comparing version 0.9.14 to 0.9.15
{ | ||
"name": "material", | ||
"version": "0.9.14", | ||
"version": "0.9.15", | ||
"description": "A lightweight implementation of Material Design Components for the web - ES6", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import build from '../module/build' | ||
import dom from '../module/dom' | ||
@@ -17,4 +18,23 @@ class Component { | ||
} | ||
destroy () { | ||
console.log('dest5roy') | ||
if (this.options.transition && this.element) { | ||
this.element.classList.remove('show') | ||
if (this.underlay) { | ||
this.underlay.classList.remove('show') | ||
} | ||
setTimeout(() => { | ||
dom.destroy(this.element) | ||
if (this.underlay) dom.destroy(this.underlay) | ||
}, this.options.transition) | ||
} else { | ||
dom.destroy(this.element) | ||
if (this.underlay) dom.destroy(this.underlay) | ||
} | ||
} | ||
} | ||
export default Component |
@@ -28,4 +28,13 @@ import Component from './component' | ||
} | ||
destroy () { | ||
// if (this.options.events) { | ||
// events.detach(this.options.events, this) | ||
// } | ||
super.destroy() | ||
this.emit?.('destroy') | ||
} | ||
} | ||
export default Control |
import { create } from '../module/layout' | ||
import clone from '../module/clone' | ||
@@ -12,3 +13,3 @@ export default { | ||
// console.log('update', info) | ||
this.dataStore[info._id] = info | ||
this.dataStore[info._id] = clone(info) | ||
@@ -15,0 +16,0 @@ // update item in the list if visible |
@@ -15,2 +15,12 @@ const mediator = ((() => { | ||
const unsubscribe = function (store, fn) { | ||
if (!mediator.stores[store]) { | ||
return this | ||
} | ||
mediator.stores[store] = mediator.stores[store].filter(subscription => subscription.callback !== fn) | ||
return this | ||
} | ||
const publish = function (store, ...args) { | ||
@@ -34,2 +44,3 @@ // console.log('publish', store, args) | ||
subscribe, | ||
unsubscribe, | ||
installTo: function (obj) { | ||
@@ -39,2 +50,3 @@ obj.subscribe = subscribe | ||
}, | ||
init: function (obj) { | ||
@@ -41,0 +53,0 @@ obj.subscribe = subscribe |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
499179
11904