Commit 2a0dc229 authored by Samantha Doherty's avatar Samantha Doherty

Toggle to show and hide local nav.

parent e3acf5b7
......@@ -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");
});
});'
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment