mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 05:40:43 +01:00
feat: remove visibilityjs (#10870)
* feat: remove visibilityjs * fix: actually remove require * style: add a newline * style: forgot a semicolon * style: accidently removed trailing newline * fix: move property declaration to its actual previous place
This commit is contained in:
@@ -134,7 +134,6 @@
|
||||
"toobusy-js": "0.5.1",
|
||||
"uglify-es": "3.3.9",
|
||||
"validator": "13.7.0",
|
||||
"visibilityjs": "2.0.2",
|
||||
"webpack": "5.74.0",
|
||||
"webpack-merge": "5.8.0",
|
||||
"winston": "3.8.1",
|
||||
|
||||
@@ -9,7 +9,6 @@ require('jquery-form');
|
||||
window.utils = require('./utils');
|
||||
require('timeago');
|
||||
|
||||
const Visibility = require('visibilityjs');
|
||||
const Benchpress = require('benchpressjs');
|
||||
Benchpress.setGlobal('config', config);
|
||||
|
||||
@@ -19,7 +18,11 @@ require('./ajaxify');
|
||||
|
||||
app = window.app || {};
|
||||
|
||||
app.isFocused = true;
|
||||
Object.defineProperty(app, 'isFocused', {
|
||||
get() {
|
||||
return document.visibilityState === 'visible';
|
||||
}
|
||||
});
|
||||
app.currentRoom = null;
|
||||
app.widgets = {};
|
||||
app.flags = {};
|
||||
@@ -95,10 +98,6 @@ if (document.readyState === 'loading') {
|
||||
app.newTopic();
|
||||
});
|
||||
|
||||
Visibility.change(function (event, state) {
|
||||
app.isFocused = state === 'visible';
|
||||
});
|
||||
|
||||
registerServiceWorker();
|
||||
|
||||
require([
|
||||
|
||||
Reference in New Issue
Block a user