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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user