Przeglądaj źródła

Add `destroy` method

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

+ 21 - 2
dist/vegas.js

@@ -1,5 +1,12 @@
-
-/* global jQuery, Zepto */
+/*!-----------------------------------------------------------------------------
+ * Vegas - Fullscreen Backgrounds and Slideshows.
+ * v2.0.5 - built 2015-03-19
+ * Licensed under the MIT License.
+ * http://vegas.jaysalvat.com/
+ * ----------------------------------------------------------------------------
+ * Copyright (C) 2010-2015 Jay Salvat
+ * http://jaysalvat.com/
+ * --------------------------------------------------------------------------*/
 
 (function ($) {
     'use strict';
@@ -603,6 +610,18 @@
                 this.noshow = this.total < 2;
                 this._preload();   
             }
+        },
+
+        destroy: function () {
+            clearTimeout(this.timeout); 
+
+            this.$elmt.removeClass('vegas-container');
+            this.$elmt.find('> .vegas-slide').remove();
+            this.$elmt.find('> .vegas-wrapper').clone(true).children().appendTo(this.$elmt);
+            this.$elmt.find('> .vegas-wrapper').remove();
+            this.$timer.remove();
+
+            this.elmt._vegas = null;
         }
     };
 

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


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


+ 12 - 2
src/vegas.js

@@ -1,6 +1,4 @@
 
-/* global jQuery, Zepto */
-
 (function ($) {
     'use strict';
 
@@ -603,6 +601,18 @@
                 this.noshow = this.total < 2;
                 this._preload();   
             }
+        },
+
+        destroy: function () {
+            clearTimeout(this.timeout); 
+
+            this.$elmt.removeClass('vegas-container');
+            this.$elmt.find('> .vegas-slide').remove();
+            this.$elmt.find('> .vegas-wrapper').clone(true).children().appendTo(this.$elmt);
+            this.$elmt.find('> .vegas-wrapper').remove();
+            this.$timer.remove();
+
+            this.elmt._vegas = null;
         }
     };
 

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