Commit 458eef37 authored by Romain Courteaud's avatar Romain Courteaud Committed by Jérome Perrin

Add a back button to navigate to the container.

parent 147826e9
......@@ -50,6 +50,8 @@
<a href="#leftpanel"
data-icon="bars"
class="menu_link ui-btn ui-icon-bars ui-btn-icon-left">Menu</a>
<a data-icon="back"
class="back_link ui-btn ui-icon-back ui-btn-icon-left">Back</a>
<h1>Dream Simulation</h1>
</header>
......
......@@ -306,6 +306,7 @@
// Render the page
.declareMethod("render", function (options) {
var gadget = this,
back_kw = {action: "view"},
page_gadget,
portal_type = "Input Module",
nav_element = gadget.props.element
......@@ -326,6 +327,7 @@
portal_type = "Input";
} else {
portal_type = "Output";
back_kw.id = options.id;
}
}
......@@ -341,7 +343,8 @@
}).push(function () {
return RSVP.all([
page_gadget.getElement(),
calculateNavigationHTML(gadget, portal_type, options)
calculateNavigationHTML(gadget, portal_type, options),
gadget.aq_pleasePublishMyState(back_kw)
]);
}).push(function (result_list) {
var nav_html = result_list[1],
......@@ -351,6 +354,11 @@
gadget.props.element.querySelector("header h1").textContent =
portal_type;
// XXX Hide the back button in case of module display?
// Update back link
gadget.props.element
.getElementsByClassName("back_link")[0].href = result_list[2];
// Update the navigation panel
// Clear the previous rendering
while (nav_element.firstChild) {
......
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