Use CustomEvent when dispatching the "webviewerloaded" event
				
					
				
			According to MDN, see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent, using initCustomEvent() is deprecated.
This commit is contained in:
		
							parent
							
								
									342dc760da
								
							
						
					
					
						commit
						d9bf571f5c
					
				@ -179,9 +179,12 @@ function webViewerLoad() {
 | 
			
		||||
    // Give custom implementations of the default viewer a simpler way to
 | 
			
		||||
    // set various `AppOptions`, by dispatching an event once all viewer
 | 
			
		||||
    // files are loaded but *before* the viewer initialization has run.
 | 
			
		||||
    const event = document.createEvent("CustomEvent");
 | 
			
		||||
    event.initCustomEvent("webviewerloaded", true, true, {
 | 
			
		||||
    const event = new CustomEvent("webviewerloaded", {
 | 
			
		||||
      bubbles: true,
 | 
			
		||||
      cancelable: true,
 | 
			
		||||
      detail: {
 | 
			
		||||
        source: window,
 | 
			
		||||
      },
 | 
			
		||||
    });
 | 
			
		||||
    try {
 | 
			
		||||
      // Attempt to dispatch the event at the embedding `document`,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user