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

Testing addition of pseudo page visibility API

This commit is contained in:
dominiclord
2016-05-18 23:58:08 -04:00
parent f07a6aba23
commit b2abd51191
4 changed files with 119 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
/* jshint esnext: true */
import { registerDocumentHiddenCallback, registerDocumentVisibleCallback } from '../utils/visibility';
import AbstractModule from './AbstractModule';
export default class extends AbstractModule {
@@ -10,6 +11,17 @@ export default class extends AbstractModule {
this.$document.on('title.changeLabel', (event, value) => {
this.changeLabel(value);
});
registerDocumentHiddenCallback(this.logHidden);
registerDocumentVisibleCallback(this.logVisible);
}
logHidden() {
console.log('Title is hidden');
}
logVisible() {
console.log('Title is visible');
}
changeLabel(value) {