Skip to content

Commit

Permalink
removed attachEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackScorp committed Mar 9, 2012
1 parent 2865321 commit 390591b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assets/js/levels.js
Expand Up @@ -46,8 +46,8 @@ Crafty.scene("Loading",function(){
bar.progressbar({
value:~~e.percent
});
// console.log("Loaded: ");
// console.log(e.src);
console.log("Loaded: ");
console.log(src);
},
function(e) {
//uh oh, error loading
Expand Down
9 changes: 1 addition & 8 deletions assets/js/loader.js
Expand Up @@ -60,8 +60,6 @@ Crafty.extend({
var src = this.currentSrc || this.src;
if (this.removeEventListener) {
this.removeEventListener('canplaythrough', pro, true);
} else if (this.detachEvent) {
this.detachEvent('oncanplaythrough', pro);
}
this.onload=null;
++j;
Expand Down Expand Up @@ -112,11 +110,8 @@ Crafty.extend({
}
if (obj.addEventListener) {
obj.addEventListener('canplaythrough', pro, true);
} else if (obj.attachEvent) {
obj.attachEvent('oncanplaythrough', pro);
}
obj.onload=pro;
obj.load();

} else if (ext === "jpg" || ext === "jpeg" || ext === "gif" || ext === "png") {
if(!obj) {
obj = new Image();
Expand All @@ -129,8 +124,6 @@ Crafty.extend({
continue; //skip if not applicable
}
obj.onerror = err;


}


Expand Down

0 comments on commit 390591b

Please sign in to comment.