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