mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Allow layout to be called without settings
This commit is contained in:
parent
eed4a45cb6
commit
dae40755a3
3 changed files with 15 additions and 11 deletions
12
dist/epub.js
vendored
12
dist/epub.js
vendored
|
@ -9790,7 +9790,7 @@ Rendition.prototype.determineLayoutProperties = function(metadata){
|
|||
orientation : orientation,
|
||||
flow : flow,
|
||||
viewport : viewport,
|
||||
minSpreadWidth : minSpreadWidth
|
||||
minSpreadWidth : minSpreadWidth
|
||||
};
|
||||
|
||||
return settings;
|
||||
|
@ -9827,12 +9827,14 @@ Rendition.prototype.flow = function(_flow){
|
|||
|
||||
// reflowable | pre-paginated
|
||||
Rendition.prototype.layout = function(settings){
|
||||
this._layout = new Layout(settings);
|
||||
this._layout.spread(settings.spread, this.settings.minSpreadWidth);
|
||||
if (settings) {
|
||||
this._layout = new Layout(settings);
|
||||
this._layout.spread(settings.spread, this.settings.minSpreadWidth);
|
||||
|
||||
this.mapping = new Mapping(this._layout);
|
||||
this.mapping = new Mapping(this._layout);
|
||||
}
|
||||
|
||||
if (this.manager) {
|
||||
if (this.manager && this._layout) {
|
||||
this.manager.applyLayout(this._layout);
|
||||
}
|
||||
|
||||
|
|
2
dist/epub.js.map
vendored
2
dist/epub.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -300,7 +300,7 @@ Rendition.prototype.determineLayoutProperties = function(metadata){
|
|||
orientation : orientation,
|
||||
flow : flow,
|
||||
viewport : viewport,
|
||||
minSpreadWidth : minSpreadWidth
|
||||
minSpreadWidth : minSpreadWidth
|
||||
};
|
||||
|
||||
return settings;
|
||||
|
@ -337,12 +337,14 @@ Rendition.prototype.flow = function(_flow){
|
|||
|
||||
// reflowable | pre-paginated
|
||||
Rendition.prototype.layout = function(settings){
|
||||
this._layout = new Layout(settings);
|
||||
this._layout.spread(settings.spread, this.settings.minSpreadWidth);
|
||||
if (settings) {
|
||||
this._layout = new Layout(settings);
|
||||
this._layout.spread(settings.spread, this.settings.minSpreadWidth);
|
||||
|
||||
this.mapping = new Mapping(this._layout);
|
||||
this.mapping = new Mapping(this._layout);
|
||||
}
|
||||
|
||||
if (this.manager) {
|
||||
if (this.manager && this._layout) {
|
||||
this.manager.applyLayout(this._layout);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue