Prechádzať zdrojové kódy

Fallback namespace created

@soyjavi 14 rokov pred
rodič
commit
ec3a1443a5
3 zmenil súbory, kde vykonal 38 pridanie a 14 odobranie
  1. 34 0
      src/Lungo.Fallback.js
  2. 2 12
      src/boot/Lungo.Boot.Section.js
  3. 2 2
      vendor/build.sh

+ 34 - 0
src/Lungo.Fallback.js

@@ -0,0 +1,34 @@
+/**
+ * ?
+ *
+ * @namespace LUNGO
+ * @class Fallback
+ *
+ * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
+ */
+
+LUNGO.Fallback = (function(lng, undefined) {
+
+	var _environment;
+
+    var androidButtons = function() {
+    	_environment = !! lng.Core.environment();
+        if (_environment.isMobile && _environment.os.name === 'android') {
+            lng.dom(document.body).on('touchstart', '.button', _addClassActiveToButton);
+            lng.dom(document.body).on('touchend', '.button', _removeClassActiveToButton);
+        }
+    };
+
+    var positionFixed = function(section) {
+    	_environment = !! lng.Core.environment();
+        if (_environment.isMobile && _environment.os.name === 'ios' && _environment.os.version >= '4.2') {
+            sections.style('position', 'fixed');
+        }
+    };
+
+    return {
+    	androidButtons: androidButtons,
+    	positionFixed: positionFixed
+    }
+
+})(LUNGO);

+ 2 - 12
src/boot/Lungo.Boot.Section.js

@@ -41,9 +41,7 @@ LUNGO.Boot.Section = (function(lng, undefined) {
     };
 
     var _initAllSections = function(sections) {
-        if (lng.Core.isMobile()) {
-            _setPositionFixedInIOS(sections);
-        }
+        lng.Fallback.positionFixed(sections);
 
         for (var i = 0, len = sections.length; i < len; i++) {
             var section = lng.dom(sections[i]);
@@ -61,17 +59,9 @@ LUNGO.Boot.Section = (function(lng, undefined) {
     };
 
     var _initAllAsides = function() {
-        lng.dom('aside').addClass('show');
+        //lng.dom('aside').addClass('show');
     };
 
-    var _setPositionFixedInIOS = function(sections) {
-        var environment = lng.Core.environment();
-
-        if (environment.os.name === 'ios' && environment.os.version >= '4.2') {
-            sections.style('position', 'fixed');
-        }
-    }
-
     return {
         start: start
     };

+ 2 - 2
vendor/build.sh

@@ -21,7 +21,7 @@ echo -e "\033[0m"============================ LUNGO COMPILER ===================
     #Main
     DIR=$LUNGO_SOURCES$LUNGO_NAMESPACE
     echo -e "\033[33m  [DIR]: "$LUNGO_SOURCES
-    FILES=(js App.js Core.js Dom.js Service.js)
+    FILES=(js App.js Core.js Dom.js Service.js Fallback.js)
     for file in "${FILES[@]}"
     do
         FILES_TO_COMPILE=$FILES_TO_COMPILE" --js "$DIR$file
@@ -96,7 +96,7 @@ FILES_TO_COMPRESS=""
     DIR=$LUNGO_SOURCES"stylesheets/css/"
 
     echo -e "\033[33m  [DIR]: "$DIR
-    FILES=(base layout layout.list widgets widgets.splash widgets.button widgets.form widgets.colour )
+    FILES=(base layout layout.nav layout.aside layout.article layout.list widgets widgets.splash widgets.button widgets.form widgets.colour )
     for file in "${FILES[@]}"
     do
         echo "    - Compressing "$DIR$LUNGO_NAMESPACE$file".css ..."