File tree Expand file tree Collapse file tree 2 files changed +29
-14
lines changed
resources/templates/columns_definitions Expand file tree Collapse file tree 2 files changed +29
-14
lines changed Original file line number Diff line number Diff line change 6161</td >
6262<td class =" text-center" >
6363 {# column collation #}
64- <select lang =" en" dir =" ltr" name =" field_collation[{{ column_number }}]" id =" field_{{ column_number }}_{{ ci - ci_offset }}" class =" form-select" >
65- <option value =" " ></option >
66- {% for charset in charsets %}
67- <optgroup label =" {{ charset .name }}" title =" {{ charset .description }}" >
68- {% for collation in charset .collations %}
69- <option value =" {{ collation .name }}" title =" {{ collation .description }}"
70- {{- column_meta ['Collation' ] is defined and collation .name == column_meta ['Collation' ] ? ' selected' }}>
71- {{- collation .name -}}
72- </option >
73- {% endfor %}
74- </optgroup >
75- {% endfor %}
76- </select >
64+ <select lang =" en" dir =" ltr" name =" field_collation[{{ column_number }}]" id =" field_{{ column_number }}_{{ ci - ci_offset }}" class =" form-select collation-select"
65+ {{- column_meta ['Collation' ] is defined ? (' data-selected="' ~ column_meta ['Collation' ] ~ ' "' )| raw : ' ' }}></select >
7766 {% set ci = ci + 1 %}
7867</td >
7968<td class =" text-center" >
Original file line number Diff line number Diff line change 11<div class =" responsivetable" >
2+ <template id =" collation_select_options" >
3+ <option value =" " ></option >
4+ {% for charset in charsets %}
5+ <optgroup label =" {{ charset .name }}" title =" {{ charset .description }}" >
6+ {% for collation in charset .collations %}
7+ <option value =" {{ collation .name }}" title =" {{ collation .description }}" >
8+ {{- collation .name -}}
9+ </option >
10+ {% endfor %}
11+ </optgroup >
12+ {% endfor %}
13+ </template >
214<table id =" table_columns" class =" table table-striped caption-top align-middle mb-0 noclick" >
315 <caption >
416 {{ t(' Structure' ) }}
112124 ' attribute_types' : attribute_types,
113125 ' privs_available' : privs_available,
114126 ' max_length' : max_length,
115- ' charsets' : charsets,
116127 ' relation_parameters' : relation_parameters
117128 }) only %}
118129 </tr>
119130 {% endfor %}
120131</table>
132+ <script>
133+ function populate_collation_select() {
134+ const select = this;
135+ const selectOptions = document.getElementById(' collation_select_options' ).content.cloneNode(true);
136+ select.appendChild(selectOptions);
137+ const selectedValue = select.dataset.selected;
138+ if (selectedValue) {
139+ select.value = selectedValue;
140+ }
141+ $(select).off(' focus' , populate_collation_select);
142+ }
143+
144+ $(' .collation-select' ).on(' focus' , populate_collation_select);
145+ $(' .collation-select[data-selected]' ).each(populate_collation_select);
146+ </script>
121147</div>
You can’t perform that action at this time.
0 commit comments