From 2a0dc2291d02dca604aa3ccb571f13c476f2e26a Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Wed, 18 May 2011 11:08:31 -0400 Subject: [PATCH] Toggle to show and hide local nav. --- plugins/MobileProfile/MobileProfilePlugin.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 659c6bed84..4c87f694bb 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -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"); + }); });' ); }