Commit 82c5ae6f authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Romain Courteaud

[renderjs_ui] Remove duplicite thead templates for ListBox Field

parent 75269d56
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_field_listbox.js" type="text/javascript"></script> <script src="gadget_erp5_field_listbox.js" type="text/javascript"></script>
<script id="listbox-hidden-thead-template" type="text/x-handlebars-template"> <script id="listbox-thead-template" type="text/x-handlebars-template">
<table> <table>
<thead class="ui-bar-inherit head"> <thead class="ui-bar-inherit head">
<tr> <tr>
...@@ -38,25 +38,6 @@ ...@@ -38,25 +38,6 @@
</table> </table>
</script> </script>
<script id="listbox-show-thead-template" type="text/x-handlebars-template">
<table>
<thead class="ui-bar-inherit head">
<tr>
{{#if show_anchor}}
<th data-i18n="Jump">Jump</th>
{{/if}}
<th></th>
{{#each head_value}}
<th data-i18n="{{data-i18n}}" class="{{class_value}}">{{text}}</th>
{{/each}}
{{#if line_icon}}
<th></th>
{{/if}}
</tr>
</thead>
</table>
</script>
<script id="listbox-hidden-tbody-template" type="text/x-handlebars-template"> <script id="listbox-hidden-tbody-template" type="text/x-handlebars-template">
<table> <table>
<tbody class="tbody"> <tbody class="tbody">
......
...@@ -5,14 +5,10 @@ ...@@ -5,14 +5,10 @@
SimpleQuery, ComplexQuery, Query, Handlebars, console, QueryFactory) { SimpleQuery, ComplexQuery, Query, Handlebars, console, QueryFactory) {
"use strict"; "use strict";
var gadget_klass = rJS(window), var gadget_klass = rJS(window),
listbox_hidden_thead_source = gadget_klass.__template_element listbox_thead_source = gadget_klass.__template_element
.getElementById("listbox-hidden-thead-template") .getElementById("listbox-thead-template")
.innerHTML, .innerHTML,
listbox_hidden_thead_template = Handlebars.compile(listbox_hidden_thead_source), listbox_thead_template = Handlebars.compile(listbox_thead_source),
listbox_show_thead_source = gadget_klass.__template_element
.getElementById("listbox-show-thead-template")
.innerHTML,
listbox_show_thead_template = Handlebars.compile(listbox_show_thead_source),
listbox_hidden_tbody_source = gadget_klass.__template_element listbox_hidden_tbody_source = gadget_klass.__template_element
.getElementById("listbox-hidden-tbody-template") .getElementById("listbox-hidden-tbody-template")
...@@ -351,11 +347,9 @@ ...@@ -351,11 +347,9 @@
hide_button_name; hide_button_name;
if (gadget.state.show_line_selector) { if (gadget.state.show_line_selector) {
listbox_thead_template = listbox_show_thead_template;
hide_button_text = 'Submit'; hide_button_text = 'Submit';
hide_button_name = 'SelectRows'; hide_button_name = 'SelectRows';
} else { } else {
listbox_thead_template = listbox_hidden_thead_template;
hide_button_text = 'Hide Rows'; hide_button_text = 'Hide Rows';
hide_button_name = 'Hide'; hide_button_name = 'Hide';
} }
......
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