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

[erp5_web_renderjs_ui] Simplify tab/action pages

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