Commit bcdc3877 authored by Fred Chasen's avatar Fred Chasen

Add beforeOverflow hook

parent 1fac52c1
......@@ -93,6 +93,7 @@ class Chunker {
this.hooks.layout = new Hook(this);
this.hooks.renderNode = new Hook(this);
this.hooks.layoutNode = new Hook(this);
this.hooks.beforeOverflow = new Hook(this);
this.hooks.overflow = new Hook(this);
this.hooks.afterPageLayout = new Hook(this);
this.hooks.afterRendered = new Hook(this);
......@@ -376,8 +377,9 @@ class Chunker {
if (!blank) {
// Listen for page overflow
page.onOverflow((overflowToken) => {
page.onOverflow(async (overflowToken) => {
console.warn("overflow on", page.id, overflowToken);
await this.hooks.overflow.trigger(overflowToken, this);
// Only reflow while rendering
if (this.rendered) {
......
......@@ -47,6 +47,7 @@ class Layout {
this.hooks.layout = new Hook();
this.hooks.renderNode = new Hook();
this.hooks.layoutNode = new Hook();
this.hooks.beforeOverflow = new Hook();
this.hooks.overflow = new Hook();
}
......
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