mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
28 lines
538 B
JavaScript
28 lines
538 B
JavaScript
/* jshint esnext: true */
|
|
import Module from './Module';
|
|
|
|
class Title extends Module {
|
|
constructor(options) {
|
|
super();
|
|
this.$el = options.$el;
|
|
this.$label = this.$el.find('.js-label');
|
|
|
|
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;
|