Commit 8806dfa7 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Preference page: simplify code

parent fe69daa6
......@@ -10,7 +10,6 @@
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_page_preference.js" type="text/javascript"></script>
</head>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.23807.13030.34833</string> </value>
<value> <string>954.45675.44850.53452</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1452177084.33</float>
<float>1476958219.29</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, document, rJS, RSVP, promiseEventListener */
/*global window, rJS */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// 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;
});
})
/////////////////////////////////////////////////////////////////
// handle acquisition
/////////////////////////////////////////////////////////////////
......@@ -49,16 +33,16 @@
select_list: ['title']
})
.push(function (result) {
gadget.props.element.textContent = result.data.rows[0].value.title;
gadget.element.textContent = result.data.rows[0].value.title;
});
}
// gadget.props.element.textContent = me;
})
.push(function () {
return gadget.translateHtml(gadget.props.element.innerHTML);
return gadget.translateHtml(gadget.element.innerHTML);
})
.push(function (my_translated_html) {
gadget.props.element.innerHTML = my_translated_html;
gadget.element.innerHTML = my_translated_html;
});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>948.20265.22771.11229</string> </value>
<value> <string>954.47266.11723.40516</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1452177225.9</float>
<float>1476958263.79</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