mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Drop ifvisible
as it was only used for Prefetch and that feature was removed in v2.17
This commit is contained in:
parent
266217434f
commit
689126c57d
|
@ -27,8 +27,6 @@ module.exports = {
|
|||
'SquireUI': "readonly",
|
||||
// node_modules/knockout but dev/External/ko.js is used
|
||||
'ko': "readonly",
|
||||
// dev/External/ifvisible.js
|
||||
'ifvisible': "readonly",
|
||||
// vendors/routes/
|
||||
'hasher': "readonly",
|
||||
'Crossroads': "readonly",
|
||||
|
|
|
@ -108,7 +108,6 @@ The result is faster and smaller download code (good for mobile networks).
|
|||
* boot.js without webpack overhead
|
||||
* Modified Jua.js to be without jQuery
|
||||
* Replaced Autolinker with simple https/email detection
|
||||
* Replaced ifvisible.js with simple drop-in replacement
|
||||
* Replaced momentToNode with proper HTML5 `<time>`
|
||||
* Replaced resize listeners with ResizeObserver
|
||||
* Replaced bootstrap.js with native drop-in replacement
|
||||
|
@ -119,6 +118,7 @@ The result is faster and smaller download code (good for mobile networks).
|
|||
* Replaced simplestatemanager with CSS @media
|
||||
* Replaced inputosaurus with own code
|
||||
* Replaced keymaster with own shortcuts handler
|
||||
* Removed ifvisible.js
|
||||
* Removed pikaday
|
||||
* Removed underscore
|
||||
* Removed polyfills
|
||||
|
|
40
dev/External/ifvisible.js
vendored
40
dev/External/ifvisible.js
vendored
|
@ -1,40 +0,0 @@
|
|||
(doc => {
|
||||
let idle = 'idle',
|
||||
visible = 'visible',
|
||||
status = visible,
|
||||
timer = 0,
|
||||
wakeUp = () => {
|
||||
clearTimeout(timer);
|
||||
status = visible;
|
||||
timer = setTimeout(() => {
|
||||
if (status === visible) {
|
||||
status = idle;
|
||||
dispatchEvent(new CustomEvent(idle));
|
||||
}
|
||||
}, 10000);
|
||||
},
|
||||
init = () => {
|
||||
init = () => 0;
|
||||
// Safari
|
||||
addEventListener('pagehide', () => status = 'hidden');
|
||||
// Else
|
||||
doc.addEventListener('visibilitychange', () => {
|
||||
status = doc.visibilityState;
|
||||
doc.hidden || wakeUp();
|
||||
});
|
||||
wakeUp();
|
||||
['mousemove','keyup','touchstart'].forEach(t => doc.addEventListener(t, wakeUp));
|
||||
['scroll','pageshow'].forEach(t => addEventListener(t, wakeUp));
|
||||
};
|
||||
|
||||
this.ifvisible = {
|
||||
idle: callback => {
|
||||
init();
|
||||
addEventListener(idle, callback);
|
||||
},
|
||||
now: () => {
|
||||
init();
|
||||
return status === visible;
|
||||
}
|
||||
};
|
||||
})(document);
|
|
@ -60,7 +60,6 @@ config.paths.js = {
|
|||
name: 'libs.js',
|
||||
src: [
|
||||
'dev/prototype.js',
|
||||
'dev/External/ifvisible.js',
|
||||
'dev/dragdropgecko.js',
|
||||
'dev/shortcuts.js',
|
||||
'vendors/routes/hasher.js',
|
||||
|
|
Loading…
Reference in a new issue