update
This commit is contained in:
@@ -260,14 +260,26 @@ export class SioFab extends DeesElement {
|
|||||||
public async firstUpdated(args: any) {
|
public async firstUpdated(args: any) {
|
||||||
super.firstUpdated(args);
|
super.firstUpdated(args);
|
||||||
const domtools = await this.domtoolsPromise;
|
const domtools = await this.domtoolsPromise;
|
||||||
const sioCombox: SioCombox = this.shadowRoot.querySelector('sio-combox');
|
|
||||||
const mainBox: HTMLElement = this.shadowRoot.querySelector('#mainbox');
|
// Set up keyboard shortcut
|
||||||
sioCombox.referenceObject = mainBox;
|
|
||||||
|
|
||||||
domtools.keyboard
|
domtools.keyboard
|
||||||
.on([domtools.keyboard.keyEnum.Ctrl, domtools.keyboard.keyEnum.S])
|
.on([domtools.keyboard.keyEnum.Ctrl, domtools.keyboard.keyEnum.S])
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.toggleCombox();
|
this.toggleCombox();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async updated(changedProperties: Map<string | number | symbol, unknown>) {
|
||||||
|
await super.updated(changedProperties);
|
||||||
|
|
||||||
|
// Set reference object when combox is rendered
|
||||||
|
if ((changedProperties.has('showCombox') || changedProperties.has('hasShownOnce')) &&
|
||||||
|
(this.showCombox || this.hasShownOnce)) {
|
||||||
|
const sioCombox: SioCombox = this.shadowRoot.querySelector('sio-combox');
|
||||||
|
const mainBox: HTMLElement = this.shadowRoot.querySelector('#mainbox');
|
||||||
|
if (sioCombox && mainBox && !sioCombox.referenceObject) {
|
||||||
|
sioCombox.referenceObject = mainBox;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,7 +393,15 @@ export class SioPdfViewer extends DeesElement {
|
|||||||
public async connectedCallback() {
|
public async connectedCallback() {
|
||||||
await super.connectedCallback();
|
await super.connectedCallback();
|
||||||
|
|
||||||
// Set up resize observer for responsive rendering
|
if (this.url) {
|
||||||
|
await this.loadPdf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async firstUpdated() {
|
||||||
|
await super.firstUpdated();
|
||||||
|
|
||||||
|
// Set up resize observer for responsive rendering after first render
|
||||||
const container = this.shadowRoot?.querySelector('.pdf-container');
|
const container = this.shadowRoot?.querySelector('.pdf-container');
|
||||||
if (container) {
|
if (container) {
|
||||||
this.resizeObserver = new ResizeObserver(() => {
|
this.resizeObserver = new ResizeObserver(() => {
|
||||||
@@ -403,10 +411,6 @@ export class SioPdfViewer extends DeesElement {
|
|||||||
});
|
});
|
||||||
this.resizeObserver.observe(container);
|
this.resizeObserver.observe(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.url) {
|
|
||||||
await this.loadPdf();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updated(changedProperties: Map<string | number | symbol, unknown>) {
|
public async updated(changedProperties: Map<string | number | symbol, unknown>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user