Toggle to show and hide local nav.

This commit is contained in:
Samantha Doherty 2011-05-18 11:08:31 -04:00
parent e3acf5b72b
commit 2a0dc2291d

View 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");
});
});'
);
}