tr3
  • Overview
  • Repository
  • Tickets
  • Downloads
  • Credits
  • Statistics
  • Projects

Repository

Fix a crash during loading screen

Parent commits : aa69891822a5cce8b89cc4f011752e095e283bbb,
Children commits : ce71e7b705a05a1d202f7f87274e022a055da053,

By Laurent Defert on 2015-06-19 21:43:49
Fix a crash during loading screen

Browse content
Difference with parent commit aa69891822a5cce8b89cc4f011752e095e283bbb
Files modified:
js/loading.js
--- 
+++ 
@@ -227,6 +227,7 @@
             _this.alpha = val;
         },
         function(val) {
+            _this.visible = false;
             _this.remove();
             stage.setFPS(current_fps);
         });

js/view.js
--- 
+++ 
@@ -359,12 +359,18 @@
 };
 
 View.prototype.touchstart = function(data) {
+    if (this.loading.visible) {
+        return;
+    }
     this.touch_start = data.global.clone();
     this.position_y0 = this.bricks.position.y;
     this.maxFPS();
 };
 
 View.prototype.touchend = View.prototype.touchendoutside = function(data) {
+    if (this.loading.visible) {
+        return;
+    }
     var dy = data.global.y - this.touch_start.y;
 
     if (this.touch_dragging && Math.abs(dy) > TOUCH_THRESHOLD) {
@@ -376,6 +382,9 @@
 
 // set the callbacks for when the mouse or a touch moves
 View.prototype.touchmove = function(data) {
+    if (this.loading.visible) {
+        return;
+    }
     if (this.touch_start) {
         this.touch_dragging = true;
         var dx = data.global.x - this.touch_start.x;
@@ -392,6 +401,9 @@
 // Based on:
 // http://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers
 View.prototype.wheelScroll = function(evt) {
+    if (this.loading.visible) {
+        return;
+    }
     // cross-browser wheel delta
     if (!evt) evt = event;
     var delta = (evt.detail < 0 || evt.wheelDelta > 0) ? 1 : -1;

Generated with KisssPM