Code style cleanup + Testing event dispatching between modules
This commit is contained in:
21
assets/scripts/modules/Button.js
Normal file
21
assets/scripts/modules/Button.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/* jshint esnext: true */
|
||||
import Module from './Module';
|
||||
|
||||
class Generic extends Module {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.$el = options.$el;
|
||||
|
||||
this.$el.on('click', (event) => {
|
||||
this.$document.trigger('title.changeLabel', [$(event.currentTarget).val()]);
|
||||
});
|
||||
}
|
||||
|
||||
// Destroy
|
||||
// ==========================================================================
|
||||
destroy() {
|
||||
this.$el.off();
|
||||
}
|
||||
}
|
||||
|
||||
export default Generic;
|
||||
Reference in New Issue
Block a user