Merge pull request #2970 from QuantumEntangledAndy/bug/modalPolyfilCenter Center the crop popup on change, when polyfilled

357c2e07567cc686085919928c8781149bf59135

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +8 -0Showing whitespace changes
public/scripts/popup.js+8 -0
@@ -182,6 +182,14 @@ export class Popup {
182 if (!this.dlg.showModal) {182 if (!this.dlg.showModal) {
183 this.dlg.classList.add('poly_dialog');183 this.dlg.classList.add('poly_dialog');
184 dialogPolyfill.registerDialog(this.dlg);184 dialogPolyfill.registerDialog(this.dlg);
185 // Force a vertical reposition after the content
186 // (like crop image) has been set
187 const resizeObserver = new ResizeObserver((entries) => {
188 for (const entry of entries) {
189 dialogPolyfill.reposition(entry.target);
190 }
191 });
192 resizeObserver.observe(this.dlg);
185 }193 }
186 this.body = this.dlg.querySelector('.popup-body');194 this.body = this.dlg.querySelector('.popup-body');
187 this.content = this.dlg.querySelector('.popup-content');195 this.content = this.dlg.querySelector('.popup-content');