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