Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed attachEvent

  • Loading branch information...
commit 390591b13b7daf5c4b0788df19b7f0c3da3aba22 1 parent 2865321
Vitalij Mik authored
Showing with 3 additions and 10 deletions.
  1. +2 −2 assets/js/levels.js
  2. +1 −8 assets/js/loader.js
4 assets/js/levels.js
View
@@ -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
9 assets/js/loader.js
View
@@ -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;
@@ -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();
@@ -129,8 +124,6 @@ Crafty.extend({
continue; //skip if not applicable
}
obj.onerror = err;
-
-
}
Please sign in to comment.
Something went wrong with that request. Please try again.