Return little less early when initializing code-block content.
This commit is contained in:
		
							parent
							
								
									d038f7c1a1
								
							
						
					
					
						commit
						352677b8b8
					
				
					 1 changed files with 6 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -21,16 +21,15 @@ class CodeBlock extends HTMLElement{
 | 
			
		|||
  }
 | 
			
		||||
  
 | 
			
		||||
  determineAndLoadContent(){
 | 
			
		||||
    const src = this.src;
 | 
			
		||||
    if(!src){
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    CodeBlock.getSource(src)
 | 
			
		||||
    CodeBlock.getSource(this.src)
 | 
			
		||||
    .then(
 | 
			
		||||
      (data) => this.consumeData(data,CodeBlock.InsertMode.Replace),
 | 
			
		||||
      (e) => this.consumeData({content:this.textContent},CodeBlock.InsertMode.Replace)
 | 
			
		||||
      (e) => {
 | 
			
		||||
        if(this.textContent.length){
 | 
			
		||||
          this.consumeData({content:this.textContent},CodeBlock.InsertMode.Replace);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
    
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  get name(){
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue