Browse Source

Rimosso bottone indietro dalle pagine principali info/events

gine 7 years ago
parent
commit
d83901f74b
2 changed files with 57 additions and 60 deletions
  1. 1 1
      www/index.html
  2. 56 59
      www/js/main.js

+ 1 - 1
www/index.html

@@ -75,7 +75,7 @@
 
         <ul>
             <!--li><a href="#">&#60; precedente</a></li-->
-            <li><a data-rel="back" href="#" data-ajax="false"><h3>BACK</h3></a></li>
+            <li><a data-rel="back" href="#" data-ajax="false"><h3>INDIETRO</h3></a></li>
             <!--li><a href="#">successiva &#62;</a></li-->
         </ul>
     </div>

+ 56 - 59
www/js/main.js

@@ -65,15 +65,14 @@ function alterContent(url) {
         break;
     case '#info':
         $("#navheader").removeClass("hide");
-        $("#navfooter").removeClass("hide");
+        $("#navfooter").addClass("hide");
         myJsonCategory(8, "#mostralistainfo");
         break;
     case '#events':
         $("#navheader").removeClass("hide");
-        $("#navfooter").removeClass("hide");
+        $("#navfooter").addClass("hide");
+        //$("#navfooter").removeClass("hide");
         EVENTS.render();
-//        ai1ec.remote.getAllEvents(ai1ec.cats.single);
-//        ai1ec.remote.getLastEvents(ai1ec.cats.single);
         break;
     case '#aggiorna':
         $("#navheader").removeClass("hide");
@@ -142,74 +141,73 @@ function setFirstRun() {
 document.addEventListener("deviceready", onDeviceReady, false);
 //le cose all'inizio
 
+$(document).on("mobileinit", function () {
 
-
-    $(document).on("mobileinit", function () {
-
-        $("body").pagecontainer({
-            defaults: true
-        });
-
-        $(".ui-loader").loader({
-            defaults: true
-        });
-        $("input").button();
+    $("body").pagecontainer({
+        defaults: true
     });
 
+    $(".ui-loader").loader({
+        defaults: true
+    });
+    $("input").button();
+});
 
+$(document).on("pagecontainerchange", function () {    
 
-    $(document).on("pagecontainerchange", function () {    
-
-        var current = $(".ui-page-active").prop("id");     // Remove active class from nav buttons
-            
-        console.log("current" + current);
-        $("[data-role='navbar'] a.ui-btn-active").removeClass("ui-btn-active");     // Add active class to current nav button
-            
-        $("[data-role='navbar'] a").each(function () {
-            var href = $(this).prop("href");        
-            if (href.indexOf(current, href.length - current.length) !== -1) {            
-                $(this).addClass("ui-btn-active");        
-            }    
-        });
-
+    var current = $(".ui-page-active").prop("id");     // Remove active class from nav buttons
+    if(current == 'info' || current == 'events'){
+        $("#navfooter").addClass("hide");
+    }
+    
+    console.log("current" + current);
+    $("[data-role='navbar'] a.ui-btn-active").removeClass("ui-btn-active");     // Add active class to current nav button
+        
+    $("[data-role='navbar'] a").each(function () {
+        var href = $(this).prop("href");        
+        if (href.indexOf(current, href.length - current.length) !== -1) {            
+            $(this).addClass("ui-btn-active");        
+        }    
     });
 
-    $(document).on("pagecreate", function () {
-        $("body > [data-role='panel']").panel();
-        $("body > [data-role='panel'] [data-role='listview']").listview();
-        $("body > [data-role='header']").toolbar();
-        $("body > [data-role='footer']").toolbar();
-        $("body > [data-role='navbar']").navbar();
-        $("#navfooter").navbar();
-        postInList();
-    });
+});
 
-    /*per inizio navigazione*/
-    var Site = function () {
-        this.homepage = "#index"; // the default page that is loaded
-        this.init();
-    };
+$(document).on("pagecreate", function () {
+    $("body > [data-role='panel']").panel();
+    $("body > [data-role='panel'] [data-role='listview']").listview();
+    $("body > [data-role='header']").toolbar();
+    $("body > [data-role='footer']").toolbar();
+    $("body > [data-role='navbar']").navbar();
+    $("#navfooter").navbar();
+    postInList();
+});
 
-    Site.prototype.init = function () {
+/*per inizio navigazione*/
+var Site = function () {
+    this.homepage = "#index"; // the default page that is loaded
+    this.init();
+};
 
-        var self = this;
+Site.prototype.init = function () {
 
-        $(document).ready(function () {
+    var self = this;
 
-            // default page if no hash given
-            // this changes the hash, so the event is fired
-            // no need to call self.navigate
+    $(document).ready(function () {
 
+        // default page if no hash given
+        // this changes the hash, so the event is fired
+        // no need to call self.navigate
 
-            window.location.hash = self.homepage;
-        });
-    };
-    // On document ready
-    $(function () {
-        // intercettaUrl();
-        // new Site();
-        // $(".minibox").click(function () {});
+
+        window.location.hash = self.homepage;
     });
+};
+// On document ready
+$(function () {
+    // intercettaUrl();
+    // new Site();
+    // $(".minibox").click(function () {});
+});
 
 function onDeviceReady() {
     // console.log('deviceready');
@@ -227,8 +225,6 @@ function onDeviceReady() {
     alterContent("#info");
 };
 
-
-
 function overlayblock() {
     $(".overlaynero").toggleClass("hide");
 }
@@ -286,6 +282,7 @@ function postInList() {
         $(":mobile-pagecontainer").pagecontainer("load", '#singleQpost' + idOra, {
             showLoadMsg: false
         });
+        $("#navfooter").removeClass("hide");
         location.hash = '#singleQpost?id=' + idOra;
     });
 };