]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/MobileProfile/MobileProfilePlugin.php
Toggle to show and hide local nav.
[quix0rs-gnu-social.git] / plugins / MobileProfile / MobileProfilePlugin.php
index 659c6bed8492e68408e206c9ef3d692820d0e746..4c87f694bb2f4c6e607e7ba847c9c84928fd9f2f 100644 (file)
@@ -309,6 +309,14 @@ class MobileProfilePlugin extends WAP20Plugin
         }
     }
 
+    function onStartShowLocalNavBlock($action)
+    {
+        if ($this->serveMobile) {
+        $action->element('a', array('href' => '#', 'id' => 'navtoggle'), 'Show Navigation');
+        return true;
+        }
+    }
+
     function onEndShowScripts($action)
     {
         $action->inlineScript('
@@ -323,6 +331,12 @@ class MobileProfilePlugin extends WAP20Plugin
                     window.location.reload();
                     return false;
                 });
+                $("#navtoggle").click(function () {
+                          $("#site_nav_local_views").fadeToggle();
+                          var text = $("#navtoggle").text();
+                          $("#navtoggle").text(
+                          text == "Show Navigation" ? "Hide Navigation" : "Show Navigation");
+                });
             });'
         );
     }