Sfoglia il codice sorgente

Fixed loadingmanager bug in 'load' event listener

Make sure loadingmanager is aware of errors occured in 'load' event handler
Pontus Leitzler 10 anni fa
parent
commit
8fabfa6852
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5 3
      src/loaders/XHRLoader.js

+ 5 - 3
src/loaders/XHRLoader.js

@@ -45,17 +45,19 @@ THREE.XHRLoader.prototype = {
 
 			THREE.Cache.add( url, response );
 
-			if ( this.status == 200 && this.readyState == 4 ) {
+			if ( this.status === 200 && this.readyState === 4 ) {
 
 				if ( onLoad ) onLoad( response );
 
+				scope.manager.itemEnd( url );
+
 			} else {
 
 				if ( onError ) onError( event );
 
-			}
+				scope.manager.itemError( url );
 
-			scope.manager.itemEnd( url );
+			}
 
 		}, false );
 

粤ICP备19079148号