Commit d00a76b4 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Allow the page relation search to be rendered multiple time

parent dbd0e899
......@@ -12,7 +12,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_relation_search.js" type="text/javascript"></script>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.53250.43607.26129</string> </value>
<value> <string>952.64761.25287.18397</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1461848814.52</float>
<float>1475744547.02</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, RSVP, Handlebars, loopEventListener*/
(function (window, rJS, RSVP, Handlebars, loopEventListener) {
/*global window, rJS, RSVP, Handlebars*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -130,25 +129,18 @@
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareService(function () {
var gadget = this,
select = gadget.props.element.querySelector("select");
if (select) {
return loopEventListener(
select,
'change',
false,
function (event) {
var target = event.target,
value = target.options[target.selectedIndex].value;
return gadget.redirect({
command: 'change',
options: {
select_template: value
}
});
.onEvent('change', function (evt) {
var target = evt.target,
value;
if (target.nodeName === 'SELECT') {
value = target.options[target.selectedIndex].value;
return this.redirect({
command: 'change',
options: {
select_template: value
}
);
});
}
});
}(window, rJS, RSVP, Handlebars, loopEventListener));
\ No newline at end of file
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>951.48046.6494.25736</string> </value>
<value> <string>954.27036.35871.42001</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1466092941.35</float>
<float>1475744573.87</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