mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-02 13:51:40 -08:00
Fix bug with resizegrid resetting on tab change. Add content to details view.
This commit is contained in:
parent
dc5b155cda
commit
25e516a1d3
7 changed files with 444 additions and 18 deletions
|
|
@ -842,6 +842,8 @@ class ResizeGrid extends ResizeGridAxis {
|
|||
axis: axis,
|
||||
callbacks: callbacks,
|
||||
});
|
||||
|
||||
this.elem.id = id;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
|
@ -1013,7 +1015,7 @@ class ResizeGrid extends ResizeGridAxis {
|
|||
|
||||
this.resize_observer = new ResizeObserver((entries) => {
|
||||
for (const entry of entries) {
|
||||
if (entry.target.id === this.elem.id) {
|
||||
if (entry.target.id === this.id) {
|
||||
clearTimeout(this.resize_observer_timer);
|
||||
this.resize_observer_timer = setTimeout(() => {
|
||||
this.onResize();
|
||||
|
|
@ -1157,6 +1159,18 @@ class ResizeGrid extends ResizeGridAxis {
|
|||
onResize() {
|
||||
/** Resizes grid items on resize observer events. */
|
||||
const curr_dims = this.elem.getBoundingClientRect();
|
||||
|
||||
// If height and width are 0, this indicates the element is not visible anymore.
|
||||
// We don't want to do anything if the element isn't visible.
|
||||
if (curr_dims.height === 0 && curr_dims.width === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do nothing if the dimensions haven't changed.
|
||||
if (JSON.stringify(curr_dims) === JSON.stringify(this.prev_dims)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const d_w = curr_dims.width - this.prev_dims.width;
|
||||
const d_h = curr_dims.height - this.prev_dims.height;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue