Comparing version 0.9.10 to 0.9.11
{ | ||
"name": "material", | ||
"version": "0.9.10", | ||
"version": "0.9.11", | ||
"description": "A lightweight implementation of Material Design Components for the web - ES6", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,13 +0,33 @@ | ||
import Control from './control' | ||
import Component from './component' | ||
import events from '../module/events' | ||
class View extends Control { | ||
static default = { | ||
base = 'view' | ||
} | ||
class View extends Component { | ||
static base = 'view' | ||
constructor (options) { | ||
super(options) | ||
this.events = {} | ||
if (this.options.events) { | ||
events.attach(this.options.events, this) | ||
} | ||
} | ||
on (event, listener) { | ||
if (!this.events[event]) { | ||
this.events[event] = [] | ||
} | ||
this.events[event].push(listener) | ||
return this | ||
} | ||
emit (event, ...args) { | ||
if (this.events[event]) { | ||
this.events[event].forEach(listener => listener.apply(this, args)) | ||
} | ||
return this | ||
} | ||
} | ||
export default View |
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
452933
10412