mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Chrome tab background performance fixes (#977)
* Add listener to detect when in background and disable polling. * Remove polling.
This commit is contained in:
parent
d9c2559b21
commit
589f5ce9e5
1 changed files with 1 additions and 4 deletions
|
@ -386,7 +386,6 @@ class Contents {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
listeners() {
|
listeners() {
|
||||||
|
|
||||||
this.imageLoadListeners();
|
this.imageLoadListeners();
|
||||||
|
|
||||||
this.mediaQueryListeners();
|
this.mediaQueryListeners();
|
||||||
|
@ -448,9 +447,7 @@ class Contents {
|
||||||
var width, height;
|
var width, height;
|
||||||
// Test size again
|
// Test size again
|
||||||
clearTimeout(this.expanding);
|
clearTimeout(this.expanding);
|
||||||
|
requestAnimationFrame(this.resizeCheck.bind(this));
|
||||||
requestAnimationFrame(this.resizeCheck.bind(this));
|
|
||||||
this.expanding = setTimeout(this.resizeListeners.bind(this), 350);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue