fix(core): update
This commit is contained in:
		| @@ -10,8 +10,8 @@ export class DomTools { | ||||
|       // lets make sure the dom is ready | ||||
|       const readyStateChangedFunc = () => { | ||||
|         if (document.readyState === 'interactive' || document.readyState === 'complete') { | ||||
|           domToolsInstance.headElement = document.querySelector('head'); | ||||
|           domToolsInstance.bodyElement = document.querySelector('body'); | ||||
|           domToolsInstance.elements.headElement = document.querySelector('head'); | ||||
|           domToolsInstance.elements.bodyElement = document.querySelector('body'); | ||||
|           domToolsInstance.domReady.resolve(); | ||||
|         } | ||||
|       }; | ||||
| @@ -24,20 +24,27 @@ export class DomTools { | ||||
|     return domToolsInstance; | ||||
|   } | ||||
|  | ||||
|   public smartstate = new plugins.smartstate.Smartstate(); | ||||
|  | ||||
|   public domToolsReady = plugins.smartpromise.defer(); | ||||
|   public domReady = plugins.smartpromise.defer(); | ||||
|   public globalStylesReady = plugins.smartpromise.defer(); | ||||
|  | ||||
|   // elements | ||||
|   public headElement: HTMLElement; | ||||
|   public bodyElement: HTMLElement; | ||||
|   public elements: { | ||||
|     headElement: HTMLElement; | ||||
|     bodyElement: HTMLElement; | ||||
|   } = { | ||||
|     headElement: null, | ||||
|     bodyElement: null, | ||||
|   }; | ||||
|  | ||||
|   public async setGlobalStyles(stylesText: string) { | ||||
|     await this.domReady.promise; | ||||
|     const styleElement = document.createElement('style'); | ||||
|     styleElement.type = 'text/css'; | ||||
|     styleElement.appendChild(document.createTextNode(stylesText)); | ||||
|     this.headElement.appendChild(styleElement); | ||||
|     this.elements.headElement.appendChild(styleElement); | ||||
|   } | ||||
|  | ||||
|   private runOnceTrackerStringMap = new Stringmap(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user