Browse Source

Merge pull request #7553 from leitzler/leitzler-loader-1

Fixed loadingmanager bug in 'load' event listener
Mr.doob 9 years ago
parent
commit
ef638639d8
1 changed files with 5 additions and 3 deletions
  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 );
 			THREE.Cache.add( url, response );
 
 
-			if ( this.status == 200 && this.readyState == 4 ) {
+			if ( this.status === 200 && this.readyState === 4 ) {
 
 
 				if ( onLoad ) onLoad( response );
 				if ( onLoad ) onLoad( response );
 
 
+				scope.manager.itemEnd( url );
+
 			} else {
 			} else {
 
 
 				if ( onError ) onError( event );
 				if ( onError ) onError( event );
 
 
-			}
+				scope.manager.itemError( url );
 
 
-			scope.manager.itemEnd( url );
+			}
 
 
 		}, false );
 		}, false );