Commit f87a4346 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Search editor: support form submit with enter

Reduce the number of event listeners.
parent 69024c79
...@@ -527,6 +527,7 @@ div[data-gadget-scope='editor_panel'] { ...@@ -527,6 +527,7 @@ div[data-gadget-scope='editor_panel'] {
div[data-gadget-scope='editor_panel'] div[data-role="header"] { div[data-gadget-scope='editor_panel'] div[data-role="header"] {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-direction: row-reverse;
} }
div[data-gadget-scope='editor_panel'] div[data-role="header"] h1 { div[data-gadget-scope='editor_panel'] div[data-role="header"] h1 {
text-align: left; text-align: left;
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>955.29626.47611.24814</string> </value> <value> <string>955.33777.42224.15633</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1480081058.6</float> <float>1480337940.73</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -26,26 +26,23 @@ ...@@ -26,26 +26,23 @@
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_search_editor.js"></script> <script src="gadget_erp5_search_editor.js"></script>
<script id="options-template" type="text/x-handlebars-template"> <script id="options-template" type="text/x-handlebars-template">
<select data-iconpos="left"> <select data-iconpos="left">
{{#each option}} {{#each option}}
<option value="{{value}}" data-i18n="{{text}}">{{text}}</option> <option value="{{value}}" data-i18n="{{text}}">{{text}}</option>
{{/each}} {{/each}}
</select> </select>
</script> </script>
<script id="filter-item-template" type="text/x-handlebars-template"> <script id="filter-item-template" type="text/x-handlebars-template">
<button type="submit" class="ui-icon ui-btn ui-btn-inline ui-icon-minus ui-icon-shadow"></button> <button class="ui-icon ui-btn ui-btn-inline ui-icon-minus ui-icon-shadow"></button>
<div class="filter_item {{class_value}}" > <div class="filter_item {{class_value}}" >
<select data-iconpos="left"> <select class="column" data-iconpos="left">
{{#each option}} {{#each option}}
{{#equal value selected_option}} {{#equal value selected_option}}
<option selected="selected" data-i18n="{{text}}" value="{{value}}">{{text}}</option> <option selected="selected" data-i18n="{{text}}" value="{{value}}">{{text}}</option>
{{else}} {{else}}
<option value="{{value}}" data-i18n="{{text}}">{{text}}</option> <option value="{{value}}" data-i18n="{{text}}">{{text}}</option>
{{/equal}} {{/equal}}
{{/each}} {{/each}}
</select> </select>
...@@ -54,7 +51,7 @@ ...@@ -54,7 +51,7 @@
{{#equal value selected_option}} {{#equal value selected_option}}
<option selected="selected" data-i18n="{{text}}" value="{{value}}">{{text}}</option> <option selected="selected" data-i18n="{{text}}" value="{{value}}">{{text}}</option>
{{else}} {{else}}
<option value="{{value}}" data-i18n="{{text}}">{{text}}</option> <option value="{{value}}" data-i18n="{{text}}">{{text}}</option>
{{/equal}} {{/equal}}
{{/each}} {{/each}}
</select> </select>
...@@ -62,54 +59,41 @@ ...@@ -62,54 +59,41 @@
<input type="{{input_type}}" value="{{input_value}}"></input> <input type="{{input_type}}" value="{{input_value}}"></input>
</div> </div>
</div> </div>
</script> </script>
<script id="filter-template" type="text/x-handlebars-template">
<div class="ui-panel-inner">
<div data-role="header" role="banner" class="ui-header ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
<div class="ui-controlgroup-controls">
<script id="filter-template" type="text/x-handlebars-template"> <button data-i18n="submit" type="submit" class="submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check">Submit</button>
<div class="ui-panel-inner">
<div data-role="header" role="banner" class="ui-header ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls">
<form class="delete">
<button data-rel="close" type="submit" data-i18n="Close" class="close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times">Close</button>
</form>
</div>
</div> </div>
</div>
<h1 class="ui-title" role="heading" data-i18n="Filter Editor" aria-level="1">Filter Editor</h1>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right"> <h1 class="ui-title" role="heading" data-i18n="Filter Editor" aria-level="1">Filter Editor</h1>
<div class="ui-controlgroup-controls"> <div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<form class="submit"> <div class="ui-controlgroup-controls">
<button data-rel="save" data-i18n="submit" type="submit" class="submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check">Submit</button> <button data-i18n="Close" class="close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times">Close</button>
</form>
</div>
</div> </div>
</div> </div>
</div>
<section class="ui-body-c ui-content-section"> <section class="ui-body-c ui-content-section">
<fieldset class="ui-controlgroup ui-corner-all"> <fieldset class="ui-controlgroup ui-corner-all">
<select data-iconpos="left" name="heard_about"> <select data-iconpos="left" name="heard_about">
<option data-i18n="All criterions (AND)" value="AND">All criterions (AND)</option> <option data-i18n="All criterions (AND)" value="AND">All criterions (AND)</option>
<option data-i18n="At least one (OR)" value="OR">At least one (OR)</option> <option data-i18n="At least one (OR)" value="OR">At least one (OR)</option>
</select> </select>
</fieldset> </fieldset>
<div class="filter_item_container"> <div class="filter_item_container">
</div> </div>
<form class="plus"> <button class="plus ui-btn-c ui-override-theme ui-btn ui-icon-plus ui-btn-icon-left ui-corner-all">Add Criteria</button>
<button type="submit" class="plus ui-btn-c ui-override-theme ui-btn ui-icon-plus ui-btn-icon-left ui-corner-all">Add Criteria</button> </section>
</form> </div>
</section>
</div>
</script> </script>
</head> </head>
<body> <body>
<form class="filter_editor"> <form class="filter_editor">
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.7210.40753.48042</string> </value> <value> <string>955.38108.27853.11810</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1474905528.91</float> <float>1480342657.32</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>952.34519.30853.16520</string> </value> <value> <string>955.38135.49149.41489</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>1468415510.46</float> <float>1480342558.79</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -633,6 +633,7 @@ div[data-gadget-scope='editor_panel'] { ...@@ -633,6 +633,7 @@ div[data-gadget-scope='editor_panel'] {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-direction: row-reverse;
h1 { h1 {
text-align: left; text-align: left;
......
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