mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
Re-enable trimming out of frame views
This commit is contained in:
parent
781fd1e3bf
commit
237051055a
3 changed files with 17 additions and 10 deletions
|
@ -250,7 +250,7 @@ class ContinuousViewManager extends DefaultViewManager {
|
|||
}
|
||||
visible.push(view);
|
||||
} else {
|
||||
// this.q.enqueue(view.destroy.bind(view));
|
||||
this.q.enqueue(view.destroy.bind(view));
|
||||
// console.log("hidden " + view.index);
|
||||
|
||||
clearTimeout(this.trimTimeout);
|
||||
|
@ -399,11 +399,9 @@ class ContinuousViewManager extends DefaultViewManager {
|
|||
|
||||
var bounds = view.bounds();
|
||||
|
||||
view.destroy.bind(view)
|
||||
this.views.remove(view);
|
||||
|
||||
if(above) {
|
||||
|
||||
if(this.settings.axis === "vertical") {
|
||||
this.scrollTo(0, prevTop - bounds.height, true);
|
||||
} else {
|
||||
|
@ -598,17 +596,18 @@ class ContinuousViewManager extends DefaultViewManager {
|
|||
}
|
||||
|
||||
updateAxis(axis, preventUpdate){
|
||||
|
||||
if (!this.isPaginated) {
|
||||
axis = "vertical";
|
||||
}
|
||||
|
||||
this.settings.axis = axis;
|
||||
|
||||
this.stage && this.stage.axis(axis);
|
||||
|
||||
this.viewSettings.axis = axis;
|
||||
|
||||
if (!this.isPaginated) {
|
||||
axis = "vertical";
|
||||
}
|
||||
|
||||
if (axis === "vertical") {
|
||||
if (axis === "vertical" && this.layout) {
|
||||
this.layout.spread("none");
|
||||
}
|
||||
|
||||
|
|
|
@ -855,6 +855,11 @@ class DefaultViewManager {
|
|||
}
|
||||
|
||||
updateAxis(axis, preventUpdate){
|
||||
|
||||
if (!this.isPaginated) {
|
||||
axis = "vertical";
|
||||
}
|
||||
|
||||
this.settings.axis = axis;
|
||||
|
||||
this.stage && this.stage.axis(axis);
|
||||
|
|
|
@ -333,6 +333,8 @@ class IframeView {
|
|||
|
||||
this.prevBounds = size;
|
||||
|
||||
this.elementBounds = bounds(this.element);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -533,10 +535,11 @@ class IframeView {
|
|||
// Stub, override with a custom functions
|
||||
}
|
||||
|
||||
bounds() {
|
||||
if(!this.elementBounds) {
|
||||
bounds(force) {
|
||||
if(force || !this.elementBounds) {
|
||||
this.elementBounds = bounds(this.element);
|
||||
}
|
||||
|
||||
return this.elementBounds;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue