mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Update axis to support vertical writing mode
This commit is contained in:
parent
eb2c57f07b
commit
101cd47513
5 changed files with 126 additions and 36 deletions
|
@ -779,7 +779,15 @@ class Contents {
|
|||
var COLUMN_WIDTH = prefixed("column-width");
|
||||
var COLUMN_FILL = prefixed("column-fill");
|
||||
|
||||
this.width("100%");
|
||||
var isVertical = this.writingMode().indexOf("vertical") === 0;
|
||||
|
||||
if (isVertical) {
|
||||
this.width(width);
|
||||
} else {
|
||||
this.width("100%");
|
||||
}
|
||||
|
||||
// this.width("100%");
|
||||
this.height(height);
|
||||
|
||||
// Deal with Mobile trying to scale to viewport
|
||||
|
@ -850,6 +858,16 @@ class Contents {
|
|||
});
|
||||
}
|
||||
|
||||
writingMode(mode) {
|
||||
let WRITING_MODE = prefixed("writing-mode");
|
||||
|
||||
if (mode && this.documentElement) {
|
||||
this.documentElement.style[WRITING_MODE] = mode;
|
||||
}
|
||||
|
||||
return this.window.getComputedStyle(this.documentElement)[WRITING_MODE] || '';
|
||||
}
|
||||
|
||||
destroy() {
|
||||
// Stop observing
|
||||
if(this.observer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue