1
0
Fork 0
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:
Fred Chasen 2016-09-07 14:12:22 +02:00
parent eed4a45cb6
commit dae40755a3
3 changed files with 15 additions and 11 deletions

10
dist/epub.js vendored
View file

@ -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

File diff suppressed because one or more lines are too long

View file

@ -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);
}