fix(wcc-dashboard): Improve scroll listener management and add new test pages
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-wcctools',
|
||||
version: '1.0.100',
|
||||
version: '1.0.101',
|
||||
description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
|
||||
}
|
||||
|
@@ -38,12 +38,8 @@ export class WccDashboard extends DeesElement {
|
||||
@property()
|
||||
public warning: string = null;
|
||||
|
||||
@property()
|
||||
public frameScrollY: number = 0;
|
||||
|
||||
@property()
|
||||
public sidebarScrollY: number = 0;
|
||||
|
||||
private frameScrollY: number = 0;
|
||||
private sidebarScrollY: number = 0;
|
||||
private scrollPositionsApplied: boolean = false;
|
||||
|
||||
@queryAsync('wcc-frame')
|
||||
@@ -222,8 +218,14 @@ export class WccDashboard extends DeesElement {
|
||||
}
|
||||
|
||||
private scrollUpdateTimeout: NodeJS.Timeout;
|
||||
private scrollListenersAttached: boolean = false;
|
||||
|
||||
public async setupScrollListeners() {
|
||||
// Prevent duplicate listeners
|
||||
if (this.scrollListenersAttached) {
|
||||
return;
|
||||
}
|
||||
|
||||
const wccFrame = await this.wccFrame;
|
||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar');
|
||||
|
||||
@@ -233,6 +235,7 @@ export class WccDashboard extends DeesElement {
|
||||
this.frameScrollY = wccFrame.scrollTop;
|
||||
this.debouncedScrollUpdate();
|
||||
});
|
||||
this.scrollListenersAttached = true;
|
||||
}
|
||||
|
||||
if (wccSidebar) {
|
||||
|
1
ts_web/pages/index.ts
Normal file
1
ts_web/pages/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const page1 = null;
|
Reference in New Issue
Block a user