Parcourir la source

New method for loading element

@soyjavi il y a 14 ans
Parent
commit
9fbbe4d7eb
1 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 8 5
      src/view/Lungo.View.Element.js

+ 8 - 5
src/view/Lungo.View.Element.js

@@ -61,18 +61,21 @@ LUNGO.View.Element = (function(lng, undefined) {
     /**
      * Set a progress to the element
      *
-     * @method progress
+     * @method loading
      *
      * @param  {string}  Element query selector
-     * @param  {number}  Percentage
-     * @param  {boolean} Show the labels: description and current percentage
-     * @param  {string}  Description
+     * @param  {number}  stylesheet (null for hide)
      */
     var loading = function(selector, stylesheet) {
         var element = lng.dom(selector);
 
         if (element) {
-            _bindAttribute(element, LUNGO.Attributes.Data.Loading, stylesheet);
+            if (stylesheet) {
+                _bindAttribute(element, LUNGO.Attributes.Data.Loading, stylesheet);
+            }
+            else {
+                element.children('.loading').addClass('disabled');
+            }
         }
     };