mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 16:41:21 +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",
|
"toobusy-js": "0.5.1",
|
||||||
"uglify-es": "3.3.9",
|
"uglify-es": "3.3.9",
|
||||||
"validator": "13.7.0",
|
"validator": "13.7.0",
|
||||||
"visibilityjs": "2.0.2",
|
|
||||||
"webpack": "5.74.0",
|
"webpack": "5.74.0",
|
||||||
"webpack-merge": "5.8.0",
|
"webpack-merge": "5.8.0",
|
||||||
"winston": "3.8.1",
|
"winston": "3.8.1",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ require('jquery-form');
|
|||||||
window.utils = require('./utils');
|
window.utils = require('./utils');
|
||||||
require('timeago');
|
require('timeago');
|
||||||
|
|
||||||
const Visibility = require('visibilityjs');
|
|
||||||
const Benchpress = require('benchpressjs');
|
const Benchpress = require('benchpressjs');
|
||||||
Benchpress.setGlobal('config', config);
|
Benchpress.setGlobal('config', config);
|
||||||
|
|
||||||
@@ -19,7 +18,11 @@ require('./ajaxify');
|
|||||||
|
|
||||||
app = window.app || {};
|
app = window.app || {};
|
||||||
|
|
||||||
app.isFocused = true;
|
Object.defineProperty(app, 'isFocused', {
|
||||||
|
get() {
|
||||||
|
return document.visibilityState === 'visible';
|
||||||
|
}
|
||||||
|
});
|
||||||
app.currentRoom = null;
|
app.currentRoom = null;
|
||||||
app.widgets = {};
|
app.widgets = {};
|
||||||
app.flags = {};
|
app.flags = {};
|
||||||
@@ -95,10 +98,6 @@ if (document.readyState === 'loading') {
|
|||||||
app.newTopic();
|
app.newTopic();
|
||||||
});
|
});
|
||||||
|
|
||||||
Visibility.change(function (event, state) {
|
|
||||||
app.isFocused = state === 'visible';
|
|
||||||
});
|
|
||||||
|
|
||||||
registerServiceWorker();
|
registerServiceWorker();
|
||||||
|
|
||||||
require([
|
require([
|
||||||
|
|||||||
Reference in New Issue
Block a user