1
0
Fork 0
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:
Fred Chasen 2017-10-27 16:47:16 -07:00
parent eb2c57f07b
commit 101cd47513
5 changed files with 126 additions and 36 deletions

View file

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