Skip to content

Commit

Permalink
gsui0ne: handle $onresize
Browse files Browse the repository at this point in the history
  • Loading branch information
mr21 committed Apr 19, 2024
1 parent 4653d1c commit 4af2092
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gsui0ne/gsui0ne.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class gsui0ne extends HTMLElement {
$isConnected = false;
#children = null;
#attributes = null;
#onresizeBind = null;
#connectionCount = 0;

constructor( o = {} ) {
Expand All @@ -20,6 +21,9 @@ class gsui0ne extends HTMLElement {
this.$element = Array.isArray( this.#children ) ? this.#children[ 0 ] : this.#children;
this.$elements = GSUfindElements( this.#children, o.$elements );
}
if ( this.$onresize ) {
this.#onresizeBind = this.$onresize.bind( this );
}
}

// .........................................................................
Expand All @@ -37,8 +41,12 @@ class gsui0ne extends HTMLElement {
this.$firstTimeConnected?.();
}
this.$connected?.();
if ( this.#onresizeBind ) {
GSUobserveSizeOf( this, this.#onresizeBind );
}
}
disconnectedCallback() {
GSUunobserveSizeOf( this, this.#onresizeBind );
this.$isConnected = false;
this.$disconnected?.();
}
Expand Down

0 comments on commit 4af2092

Please sign in to comment.