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

Restructuring of scripts for better use of ES6 concepts

- Optimized use of common properties (, , ...)
- Dispatching events in an attempt to de-globalize certain variables used in the past
- Attempt to organize files in a more logical manner
This commit is contained in:
dominiclord
2016-05-18 23:12:36 -04:00
parent 09016521ed
commit f07a6aba23
12 changed files with 159 additions and 213 deletions

View File

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