diff --git a/service2.js b/service2.js index b87191c..79bc71e 100644 --- a/service2.js +++ b/service2.js @@ -9,6 +9,14 @@ */ let besServices = [] +// TODO: Window resize may cause host element(s) to move. That needs correction panel and status icon +// repositioning. Also, should any parent element of our service host element move, we should reposition +// correction panel and status icon. How to do this? Alas there is no PlacementObserver to monitor host +// element movements. +window.addEventListener('resize', () => + besServices.forEach(service => service.onReposition()) +) + /************************************************************************* * * Base class for all grammar-checking services @@ -135,6 +143,14 @@ class BesService { }, 500) } + /** + * Called to report repositioning + */ + onReposition() { + this.setCorrectionPanelSize() + this.setStatusDivPosition() + } + /** * Called to report resizing */