Procházet zdrojové kódy

Add firstTransition and firstTransitionDuration options

Jay Salvat před 8 roky
rodič
revize
a4e9b7bea0
4 změnil soubory, kde provedl 70 přidání a 40 odebrání
  1. 35 20
      dist/vegas.js
  2. 0 0
      dist/vegas.min.js
  3. 0 0
      dist/vegas.min.js.map
  4. 35 20
      src/vegas.js

+ 35 - 20
dist/vegas.js

@@ -12,26 +12,28 @@
     'use strict';
 
     var defaults = {
-        slide:              0,
-        delay:              5000,
-        loop:               true,
-        preload:            false,
-        preloadImage:       false,
-        preloadVideo:       false,
-        timer:              true,
-        overlay:            false,
-        autoplay:           true,
-        shuffle:            false,
-        cover:              true,
-        color:              null,
-        align:              'center',
-        valign:             'center',
-        transition:         'fade',
-        transitionDuration: 1000,
-        transitionRegister: [],
-        animation:          null,
-        animationDuration:  'auto',
-        animationRegister:  [],
+        slide:                   0,
+        delay:                   5000,
+        loop:                    true,
+        preload:                 false,
+        preloadImage:            false,
+        preloadVideo:            false,
+        timer:                   true,
+        overlay:                 false,
+        autoplay:                true,
+        shuffle:                 false,
+        cover:                   true,
+        color:                   null,
+        align:                   'center',
+        valign:                  'center',
+        firstTransition:         null,
+        firstTransitionDuration: null,
+        transition:              'fade',
+        transitionDuration:      1000,
+        transitionRegister:      [],
+        animation:               null,
+        animationDuration:       'auto',
+        animationRegister:       [],
         init:  function () {},
         play:  function () {},
         pause: function () {},
@@ -72,6 +74,7 @@
         this.$overlay     = null;
         this.$slide       = null;
         this.timeout      = null;
+        this.first        = true;
 
         this.transitions = [
             'fade', 'fade2',
@@ -352,6 +355,18 @@
                 animation          = this._options('animation'),
                 animationDuration  = this._options('animationDuration');
 
+            if (this.settings.firstTransition && this.first) {
+                transition = this.settings.firstTransition || transition;
+            }
+
+            if (this.settings.firstTransitionDuration && this.first) {
+                transitionDuration = this.settings.firstTransitionDuration || transitionDuration;
+            }
+
+            if (this.first) {
+                this.first = false;
+            }
+
             if (cover !== 'repeat') {
                 if (cover === true) {
                     cover = 'cover';

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/vegas.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/vegas.min.js.map


+ 35 - 20
src/vegas.js

@@ -3,26 +3,28 @@
     'use strict';
 
     var defaults = {
-        slide:              0,
-        delay:              5000,
-        loop:               true,
-        preload:            false,
-        preloadImage:       false,
-        preloadVideo:       false,
-        timer:              true,
-        overlay:            false,
-        autoplay:           true,
-        shuffle:            false,
-        cover:              true,
-        color:              null,
-        align:              'center',
-        valign:             'center',
-        transition:         'fade',
-        transitionDuration: 1000,
-        transitionRegister: [],
-        animation:          null,
-        animationDuration:  'auto',
-        animationRegister:  [],
+        slide:                   0,
+        delay:                   5000,
+        loop:                    true,
+        preload:                 false,
+        preloadImage:            false,
+        preloadVideo:            false,
+        timer:                   true,
+        overlay:                 false,
+        autoplay:                true,
+        shuffle:                 false,
+        cover:                   true,
+        color:                   null,
+        align:                   'center',
+        valign:                  'center',
+        firstTransition:         null,
+        firstTransitionDuration: null,
+        transition:              'fade',
+        transitionDuration:      1000,
+        transitionRegister:      [],
+        animation:               null,
+        animationDuration:       'auto',
+        animationRegister:       [],
         init:  function () {},
         play:  function () {},
         pause: function () {},
@@ -63,6 +65,7 @@
         this.$overlay     = null;
         this.$slide       = null;
         this.timeout      = null;
+        this.first        = true;
 
         this.transitions = [
             'fade', 'fade2',
@@ -343,6 +346,18 @@
                 animation          = this._options('animation'),
                 animationDuration  = this._options('animationDuration');
 
+            if (this.settings.firstTransition && this.first) {
+                transition = this.settings.firstTransition || transition;
+            }
+
+            if (this.settings.firstTransitionDuration && this.first) {
+                transitionDuration = this.settings.firstTransitionDuration || transitionDuration;
+            }
+
+            if (this.first) {
+                this.first = false;
+            }
+
             if (cover !== 'repeat') {
                 if (cover === true) {
                     cover = 'cover';

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů