Commit 60e7ca3a authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Simplify tab/action pages

parent 89cc018b
......@@ -8,28 +8,11 @@
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var gadget_klass = rJS(window),
source = gadget_klass.__template_element
table_template = Handlebars.compile(gadget_klass.__template_element
.getElementById("table-template")
.innerHTML,
table_template = Handlebars.compile(source);
.innerHTML);
gadget_klass
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.ready(function (g) {
g.props = {};
})
// Assign the element to a variable
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
......@@ -131,7 +114,7 @@
]);
})
.push(function (last_result_list) {
gadget.props.element.innerHTML = last_result_list[0];
gadget.element.innerHTML = last_result_list[0];
return gadget.updateHeader({
back_url: result_list[0],
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.28791.23999.5956</string> </value>
<value> <string>955.29509.41156.45721</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1460380327.89</float>
<float>1479825199.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,28 +8,11 @@
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var gadget_klass = rJS(window),
source = gadget_klass.__template_element
table_template = Handlebars.compile(gadget_klass.__template_element
.getElementById("table-template")
.innerHTML,
table_template = Handlebars.compile(source);
.innerHTML);
gadget_klass
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.ready(function (g) {
g.props = {};
})
// Assign the element to a variable
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
......@@ -158,7 +141,7 @@
}));
})
.push(function (my_translated_html) {
gadget.props.element.innerHTML = my_translated_html;
gadget.element.innerHTML = my_translated_html;
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.28781.23028.58368</string> </value>
<value> <string>955.29510.26421.23705</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1460380878.05</float>
<float>1479825091.01</float>
<string>UTC</string>
</tuple>
</state>
......
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