Skip to content

Commit

Permalink
Merge pull request #2584 from tvdeyen/use-fewer-select2
Browse files Browse the repository at this point in the history
Use fewer select2
  • Loading branch information
tvdeyen authored Oct 30, 2023
2 parents 26a9ef9 + e686a7b commit bbeb6e5
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/javascript/alchemy_admin/components/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Select extends HTMLSelectElement {
this.classList.add("alchemy_selectbox")

$(this).select2({
minimumResultsForSearch: 7,
minimumResultsForSearch: 5,
dropdownAutoWidth: true
})
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/ingredients/_file_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
[Alchemy.t(:above), "no_float"],
[Alchemy.t(:left), "left"],
[Alchemy.t(:right), "right"]
], include_blank: Alchemy.t('Layout default'), input_html: {is: 'alchemy-select'} %>
], include_blank: Alchemy.t('Layout default') %>
<%- end -%>
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
[Alchemy.t(:above), "no_float"],
[Alchemy.t(:left), "left"],
[Alchemy.t(:right), "right"]
], include_blank: Alchemy.t("Layout default"), input_html: {is: 'alchemy-select'} %>
], include_blank: Alchemy.t("Layout default") %>
<%- end -%>
3 changes: 1 addition & 2 deletions app/views/alchemy/admin/ingredients/_video_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
<%= f.input :loop, as: :boolean %>
<%= f.input :muted, as: :boolean %>
<%= f.input :playsinline, as: :boolean %>
<%= f.input :preload, collection: %w(auto none metadata),
include_blank: false, input_html: {is: 'alchemy-select'} %>
<%= f.input :preload, collection: %w(auto none metadata), include_blank: false %>
3 changes: 1 addition & 2 deletions app/views/alchemy/admin/languages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<% if language.errors[:locale].present? || language.locale.present? %>
<%= f.input :locale,
collection: language.matching_locales.presence || ::I18n.available_locales,
selected: language.locale || language.language_code || ::I18n.default_locale.to_s,
input_html: {is: 'alchemy-select'} %>
selected: language.locale || language.language_code || ::I18n.default_locale.to_s %>
<% end %>
<%= f.input :frontpage_name %>
<%= f.input :page_layout,
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/pages/_external_link.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</label>
<%= select_tag 'external_link_target',
options_for_select(Alchemy::Page.link_target_options),
{class: 'link_target', is: 'alchemy-select'} %>
class: 'link_target' %>
</div>
<div class="submit">
<%= button_tag Alchemy.t(:apply), class: 'create-link button', data: { link_type: 'external' } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/pages/_file_link.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</label>
<%= select_tag 'file_link_target',
options_for_select(Alchemy::Page.link_target_options),
class: 'link_target', is: 'alchemy-select' %>
class: 'link_target' %>
</div>
<div class="submit">
<%= button_tag Alchemy.t(:apply), class: 'create-link button', data: { link_type: 'file' } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/pages/_internal_link.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</label>
<%= select_tag 'internal_link_target',
options_for_select(Alchemy::Page.link_target_options),
class: 'link_target', is: 'alchemy-select' %>
class: 'link_target' %>
</div>
<div class="submit">
<%= button_tag Alchemy.t(:apply), class: 'create-link button', data: { link_type: 'internal' } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
data: {'auto-submit' => true}
) %>
<% end %>
<label><%= Alchemy.t("Language tree") %></label>
<label for="language_id">
<%= Alchemy.t("Language tree") %>
</label>
</div>
<div class="toolbar_spacer"></div>
<% end %>

0 comments on commit bbeb6e5

Please sign in to comment.