]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
adds docs comments to orbit slider
authorzurbchris <chris@zurb.com>
Wed, 18 Nov 2015 03:25:52 +0000 (19:25 -0800)
committerzurbchris <chris@zurb.com>
Wed, 18 Nov 2015 03:25:52 +0000 (19:25 -0800)
js/foundation.orbit.js

index 943210c3c97a3210c81173ba2a0d925883866ee7..638bc315cea403308540d27eaca7e49f4aeb3469 100644 (file)
           'ARROW_RIGHT': 'previous'
         }
     });
-    // this.$element.trigger('init.zf.orbit');
   }
   Orbit.defaults = {
+    /**
+     * Tells the JS to loadBullets.
+     * @option
+     * @example true
+     */
     bullets: true,
+    /**
+     * Tells the JS to apply event listeners to nav buttons
+     * @option
+     * @example true
+     */
     navButtons: true,
+    /**
+     * motion-ui animation class to apply
+     * @option
+     * @example 'slide-in-right'
+     */
     animInFromRight: 'slide-in-right',
+    /**
+     * motion-ui animation class to apply
+     * @option
+     * @example 'slide-out-right'
+     */
     animOutToRight: 'slide-out-right',
+    /**
+     * motion-ui animation class to apply
+     * @option
+     * @example 'slide-in-left'
+     *
+     */
     animInFromLeft: 'slide-in-left',
+    /**
+     * motion-ui animation class to apply
+     * @option
+     * @example 'slide-out-left'
+     */
     animOutToLeft: 'slide-out-left',
+    /**
+     * Allows Orbit to automatically animate on page load.
+     * @option
+     * @example true
+     */
     autoPlay: true,
+    /**
+     * Amount of time, in ms, between slide transitions
+     * @option
+     * @example 5000
+     */
     timerDelay: 5000,
+    /**
+     * Allows Orbit to infinitely loop through the slides
+     * @option
+     * @example true
+     */
     infiniteWrap: true,
+    /**
+     * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library
+     * @option
+     * @example true
+     */
     swipe: true,
+    /**
+     * Allows the timing function to pause animation on hover.
+     * @option
+     * @example true
+     */
     pauseOnHover: true,
+    /**
+     * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys
+     * @option
+     * @example true
+     */
     accessible: true,
+    /**
+     * Class applied to the container of Orbit
+     * @option
+     * @example 'orbit-container'
+     */
     containerClass: 'orbit-container',
+    /**
+     * Class applied to individual slides.
+     * @option
+     * @example 'orbit-slide'
+     */
     slideClass: 'orbit-slide',
+    /**
+     * Class applied to the bullet container. You're welcome.
+     * @option
+     * @example 'orbit-bullets'
+     */
     boxOfBullets: 'orbit-bullets',
+    /**
+     * Class applied to the `next` navigation button.
+     * @option
+     * @example 'orbit-next'
+     */
     nextClass: 'orbit-next',
+    /**
+     * Class applied to the `previous` navigation button.
+     * @option
+     * @example 'orbit-previous'
+     */
     prevClass: 'orbit-previous'
   };
   /**
     }
 
     if(this.options.bullets){
-      this.loadBullets();
+      this._loadBullets();
     }
 
     this._events();
    * @function
    * @private
    */
-  Orbit.prototype.loadBullets = function(){
+  Orbit.prototype._loadBullets = function(){
     this.$bullets = this.$element.find('.' + this.options.boxOfBullets).find('button');
   };
   /**
    */
   Orbit.prototype._prepareForOrbit = function(){
     var _this = this;
-    this.setWrapperHeight(function(max){
-      _this.setSlideHeight(max);
+    this._setWrapperHeight(function(max){
+      _this._setSlideHeight(max);
     });
   };
   /**
    * @private
    * @param {Function} cb - a callback function to fire when complete.
    */
-  Orbit.prototype.setWrapperHeight = function(cb){//rewrite this to `for` loop
+  Orbit.prototype._setWrapperHeight = function(cb){//rewrite this to `for` loop
     var max = 0, temp, counter = 0;
 
     this.$slides.each(function(){
    * @function
    * @private
    */
-  Orbit.prototype.setSlideHeight = function(height){
+  Orbit.prototype._setSlideHeight = function(height){
     this.$slides.each(function(){
       $(this).css('max-height', height);
     });
     delete this.timer;
     this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
     Foundation.unregisterPlugin(this);
-    // this.$element.trigger('destroyed.zf.orbit');
   };
 
   Foundation.plugin(Orbit);