Commit bf266113 authored by Fred Chasen's avatar Fred Chasen

Emit size event from Previewer

parent 780982f6
...@@ -114,6 +114,8 @@ afterRendered(pages) ...@@ -114,6 +114,8 @@ afterRendered(pages)
// Polisher // Polisher
beforeTreeParse(text, sheet) beforeTreeParse(text, sheet)
beforeTreeWalk(ast)
afterTreeWalk(ast, sheet)
onUrl(urlNode) onUrl(urlNode)
onAtPage(atPageNode) onAtPage(atPageNode)
onRule(ruleNode) onRule(ruleNode)
...@@ -204,11 +206,11 @@ The tests and specs can be run within the container by passing a `seccomp` file ...@@ -204,11 +206,11 @@ The tests and specs can be run within the container by passing a `seccomp` file
docker run -it --security-opt 'seccomp=seccomp.json' pagedmedia/pagedjs npm test docker run -it --security-opt 'seccomp=seccomp.json' pagedmedia/pagedjs npm test
``` ```
## Contributors ## Contributors
### Core team ### Core team
The core team behind paged.js includes [Adam Hyde](https://adamhyde.net), [Julie Blanc](http://julie-blanc.fr/), [Fred Chasen](http://fchasen.com/) & Julien Taquet. The core team behind paged.js includes [Adam Hyde](https://adamhyde.net), [Julie Blanc](http://julie-blanc.fr/), [Fred Chasen](http://fchasen.com/) & Julien Taquet.
## Licence ## Licence
MIT License (MIT), which you can read [here](https://gitlab.pagedmedia.org/tools/pagedjs/blob/master/LICENSE.md) MIT License (MIT), which you can read [here](https://gitlab.pagedmedia.org/tools/pagedjs/blob/master/LICENSE.md)
\ No newline at end of file
...@@ -52,6 +52,7 @@ class Previewer { ...@@ -52,6 +52,7 @@ class Previewer {
handlers.on("size", (size) => { handlers.on("size", (size) => {
this.size = size; this.size = size;
this.emit("size", size);
}); });
return handlers; return handlers;
...@@ -125,7 +126,7 @@ class Previewer { ...@@ -125,7 +126,7 @@ class Previewer {
this.polisher.setup(); this.polisher.setup();
let handlers = this.initializeHandlers(); this.handlers = this.initializeHandlers();
let styleText = await this.polisher.add(...stylesheets); let styleText = await this.polisher.add(...stylesheets);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment