Explorar el Código

New method refresh() for scroll namespace

@soyjavi hace 14 años
padre
commit
f52a19918b
Se han modificado 1 ficheros con 17 adiciones y 1 borrados
  1. 17 1
      src/view/Lungo.View.Scroll.js

+ 17 - 1
src/view/Lungo.View.Scroll.js

@@ -75,6 +75,21 @@ LUNGO.View.Scroll = (function(lng, undefined) {
         _saveScrollInCache(id);
     };
 
+    /**
+     * Removes iScroll instance.
+     *
+     * @method refresh
+     *
+     * @param {Object} Id of the <section>
+     */
+    var refresh = function(id) {
+        var scroll = lng.dom('#' + id);
+        if (_needScroll(scroll)) {
+            var container = scroll.children().first();
+            _saveScrollInCache(id);
+        }
+    };
+
     /**
      * Removes iScroll instance.
      *
@@ -151,7 +166,8 @@ LUNGO.View.Scroll = (function(lng, undefined) {
         create: create,
         update: update,
         remove: remove,
-        isHorizontal: isHorizontal
+        isHorizontal: isHorizontal,
+        refresh: refresh
     };
 
 })(LUNGO);