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