]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
removes files that have been combined with others, minor code cleanup in motion and...
authorzurbchris <chris@zurb.com>
Tue, 17 Nov 2015 18:38:59 +0000 (10:38 -0800)
committerzurbchris <chris@zurb.com>
Tue, 17 Nov 2015 18:38:59 +0000 (10:38 -0800)
js/foundation.util.animationFrame.js [deleted file]
js/foundation.util.motion.js
js/foundation.util.onImagesLoaded.js [deleted file]
js/foundation.util.swipe.js
js/foundation.utils.timer.js [deleted file]

diff --git a/js/foundation.util.animationFrame.js b/js/foundation.util.animationFrame.js
deleted file mode 100644 (file)
index cb02686..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-!function($, Foundation, window){
-   var Move = function(duration, elem, fn){
-    var anim, prog, start = null, _this = this;
-    this.dont = function(){
-      if(anim !== undefined){
-        window.cancelAnimationFrame(anim);
-        duration = 0;
-        return true;
-      }
-      return false;
-    };
-    this.do = function(ts){//timestamp returned from requestAnimationFrame
-      if(!ts || !start){ start = ts = window.performance.now(); }
-      prog = ts - start;
-      // console.log(prog, ts, start);
-      fn.apply(elem);//call the cb
-      if(prog < duration){
-        anim = window.requestAnimationFrame(_this.do, elem);
-      }else{
-        window.cancelAnimationFrame(anim);
-        elem.trigger('finished.zf.animate', [elem]);
-      }
-    };
-    window.requestAnimationFrame(this.do);
-  };
-  Foundation.Move = Move;
-}(jQuery, window.Foundation, window);
index c5190e8ed3e2587a14ef55266002ac0fb195a9ee..04392289c5c2f3c3dd5f7ff95cce824a1627386b 100644 (file)
@@ -1,7 +1,6 @@
 /**
  * Motion module.
  * @module foundation.motion
- * @requires foundation.util.animationFrame
  */
 !function($, Foundation) {
 
@@ -39,7 +38,7 @@ function animate(isIn, element, animation, cb) {
   // });
 
   // Clean up the animation when it finishes
-  element.one(Foundation.transitionend, finish).one('finished.zf.animate', finish);
+  element.one(Foundation.transitionend, finish);//.one('finished.zf.animate', finish);
 
   // Hides the element (for out animations), resets the element, and runs a callback
   function finish() {
diff --git a/js/foundation.util.onImagesLoaded.js b/js/foundation.util.onImagesLoaded.js
deleted file mode 100644 (file)
index db8151d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-!function($, Foundation){
-  'use strict';
-  /**
-   * Runs a callback function when images are fully loaded.
-   * @param {Object} images - Image(s) to check if loaded.
-   * @param {Func} callback - Function to execute when image is fully loaded.
-   */
-  var onImagesLoaded = function(images, callback){
-    var self = this,
-        unloaded = images.length;
-
-    if (unloaded === 0) {
-      callback();
-    }
-
-    var singleImageLoaded = function() {
-      unloaded--;
-      if (unloaded === 0) {
-        callback();
-      }
-    };
-
-    images.each(function() {
-      if (this.complete) {
-        singleImageLoaded();
-      }
-      else if (typeof this.naturalWidth !== 'undefined' && this.naturalWidth > 0) {
-        singleImageLoaded();
-      }
-      else {
-        $(this).one('load', function() {
-          singleImageLoaded();
-        });
-      }
-    });
-  };
-  Foundation.onImagesLoaded = onImagesLoaded;
-}(jQuery, window.Foundation);
index 6e8cc35b91e75a884d01d2cdbbb4410ac794b3ec..4eb0fe039b5acdbd6658d7165b0b20bc27184df5 100644 (file)
       var dir;
       elapsedTime = new Date().getTime() - startTime;
       if(Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
-        dir = dx > 0 ? 'left' : 'right'
+        dir = dx > 0 ? 'left' : 'right';
       }
       else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
-        dir = dy > 0 ? 'down' : 'up'
+        dir = dy > 0 ? 'down' : 'up';
       }
       if(dir) {
         onTouchEnd.call(this);
@@ -52,7 +52,7 @@
       startPosX = e.touches[0].pageX;
       startPosY = e.touches[0].pageY;
       isMoving = true;
-      startTime = new Date().getTime()
+      startTime = new Date().getTime();
       this.addEventListener('touchmove', onTouchMove, false);
       this.addEventListener('touchend', onTouchEnd, false);
     }
diff --git a/js/foundation.utils.timer.js b/js/foundation.utils.timer.js
deleted file mode 100644 (file)
index 03e1e1f..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-!function($, Foundation){
-
-  /******************************************************************
-  /** A very simple timer for animated elements within Foundation. **
-  /** Allows your script to pause and restart later with fn call.  **
-  /**  Feel free to add features, comments, or use case examples.  **
-  /*****************************************************************/
-
-  var Timer = function(elem, options, cb){
-    var _this = this,
-        duration = options.duration,//options is an object for easily adding features later.
-        nameSpace = Object.keys(elem.data())[0] || 'timer',
-        remain = -1,
-        start,
-        timer;
-
-    this.restart = function(){
-      remain = -1;
-      clearTimeout(timer);
-      this.start();
-    };
-
-    this.start = function(){
-      // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
-      clearTimeout(timer);
-      remain = remain <= 0 ? duration : remain;
-      elem.data('paused', false);
-      start = Date.now();
-      timer = setTimeout(function(){
-        if(options.infinite){
-          _this.restart();//rerun the timer.
-        }
-        cb();
-      }, remain);
-      elem.trigger('timerstart.zf.' + nameSpace);
-    };
-
-    this.pause = function(){
-      //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
-      clearTimeout(timer);
-      elem.data('paused', true);
-      var end = Date.now();
-      remain = remain - (end - start);
-      elem.trigger('timerpaused.zf.' + nameSpace);
-    };
-  };
-
-  Foundation.Timer = Timer;
-
-}(jQuery, window.Foundation);