@yuebai008/cli
Version:
Command line interface for rapid qg-minigame development
1 lines • 1.04 kB
JavaScript
import*as Common from"../../core/common/common.js";import*as UI from"../../ui/legacy/legacy.js";import{ComputedStyleModel}from"./ComputedStyleModel.js";export class ElementsSidebarPane extends UI.Widget.VBox{computedStyleModelInternal;updateThrottler;updateWhenVisible;constructor(e){super(!0,e),this.element.classList.add("flex-none"),this.computedStyleModelInternal=new ComputedStyleModel,this.computedStyleModelInternal.addEventListener("ComputedStyleChanged",this.onCSSModelChanged,this),this.updateThrottler=new Common.Throttler.Throttler(100),this.updateWhenVisible=!1}node(){return this.computedStyleModelInternal.node()}cssModel(){return this.computedStyleModelInternal.cssModel()}computedStyleModel(){return this.computedStyleModelInternal}async doUpdate(){}update(){this.updateWhenVisible=!this.isShowing(),this.updateWhenVisible||this.updateThrottler.schedule(function(){return this.isShowing()?this.doUpdate():Promise.resolve()}.bind(this))}wasShown(){super.wasShown(),this.updateWhenVisible&&this.update()}onCSSModelChanged(e){}}