Przeglądaj źródła

Reset current slide to 0 if slide doesn't exist

Jay Salvat 10 lat temu
rodzic
commit
c51986b3eb
4 zmienionych plików z 10 dodań i 2 usunięć
  1. 5 1
      dist/vegas.js
  2. 1 1
      dist/vegas.min.js
  3. 0 0
      dist/vegas.min.js.map
  4. 4 0
      src/vegas.js

+ 5 - 1
dist/vegas.js

@@ -1,6 +1,6 @@
 /*!-----------------------------------------------------------------------------
  * Vegas - Fullscreen Backgrounds and Slideshows.
- * v2.0.0-wip - built 2015-01-16
+ * v2.0.0-wip - built 2015-01-18
  * Licensed under the MIT License.
  * http://vegas.jaysalvat.com/
  * ----------------------------------------------------------------------------
@@ -212,6 +212,10 @@
         },
 
         _goto: function (nb) {
+            if (typeof this.settings.slides[nb] === 'undefined') {
+                nb = 0;
+            }
+
             this.slide = nb;
 
             var $slide,

Plik diff jest za duży
+ 1 - 1
dist/vegas.min.js


Plik diff jest za duży
+ 0 - 0
dist/vegas.min.js.map


+ 4 - 0
src/vegas.js

@@ -203,6 +203,10 @@
         },
 
         _goto: function (nb) {
+            if (typeof this.settings.slides[nb] === 'undefined') {
+                nb = 0;
+            }
+
             this.slide = nb;
 
             var $slide,

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików