1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00

Code style cleanup + Testing event dispatching between modules

This commit is contained in:
dominiclord
2016-04-04 21:31:15 -04:00
parent 6d3b8134f1
commit 09016521ed
9 changed files with 464 additions and 82 deletions

View File

@@ -1,23 +1,27 @@
// ==========================================================================
// Title module
// ==========================================================================
/* jshint esnext: true */
import Module from './Module';
class Title extends Module {
constructor(options) {
super();
this.$el = options.$el;
this.$el = options.$el;
this.$label = this.$el.find('.js-label');
console.log('Title module');
console.log(this.$el);
this.$document.on('title.changeLabel', (event, value) => {
this.changeLabel(value);
});
}
changeLabel(value) {
this.$label.text(value);
}
// Destroy
// ==========================================================================
destroy() {
this.$document.off('title.changeLabel');
this.$el.off();
}
}
export default Title;