Prechádzať zdrojové kódy

Element.Carousel.refresh()

For refresh the instance
soyjavi 13 rokov pred
rodič
commit
23392fc707
3 zmenil súbory, kde vykonal 11 pridanie a 10 odobranie
  1. 0 4
      grunt.js
  2. 1 1
      packages/lungo/lungo.js
  3. 10 5
      src/element/Lungo.Element.Carousel.js

+ 0 - 4
grunt.js

@@ -64,10 +64,6 @@ module.exports = function(grunt) {
       js: {
         src: ['<banner>', 'build/<%=meta.file%>.js'],
         dest: 'packages/<%=meta.file%>/<%=meta.file%>.js'
-      },
-      js: {
-        src: ['<banner>', 'build/<%=meta.file%>.device.js'],
-        dest: 'packages/<%=meta.file%>.device/<%=meta.file%>.device.js'
       }
     },
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
packages/lungo/lungo.js


+ 10 - 5
src/element/Lungo.Element.Carousel.js

@@ -27,10 +27,6 @@ Lungo.Element.Carousel = function(element, callback) {
         deltaX: 0
     };
 
-    var position = function() {
-        return _instance.index;
-    };
-
     var prev = function(delay) {
         if (_instance.index) {
             _slide(_instance.index-1, _instance.speed);
@@ -45,6 +41,14 @@ Lungo.Element.Carousel = function(element, callback) {
         }
     };
 
+    var position = function() {
+        return _instance.index;
+    };
+
+    var refresh = function() {
+        _setup();
+    };
+
     var _setup = function() {
         _instance.slides = _instance.element.children;
         _instance.slides_length = _instance.slides.length;
@@ -152,6 +156,7 @@ Lungo.Element.Carousel = function(element, callback) {
     return {
         prev: prev,
         next: next,
-        position: position
+        position: position,
+        refresh: refresh
     };
 };