From 5eccab9295524e02de81a86766d7468cf55a405c Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Thu, 28 Dec 2023 04:16:49 +0000 Subject: [PATCH] Improves filter rendering on narrow screens by replacing the layout tables with a flex layout. (#39806). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer (@jkraemer). git-svn-id: https://svn.redmine.org/redmine/trunk@22574 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/gantts/show.html.erb | 22 ++++------ app/views/queries/_columns.html.erb | 18 ++++---- app/views/queries/_filters.html.erb | 4 +- app/views/queries/_query_form.html.erb | 38 ++++++++--------- public/javascripts/application.js | 30 ++++++------- public/stylesheets/application.css | 59 +++++++++++++++++++------- public/stylesheets/responsive.css | 3 ++ 7 files changed, 100 insertions(+), 74 deletions(-) diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index e3bfa02ae..43e430311 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -23,23 +23,23 @@ diff --git a/app/views/queries/_columns.html.erb b/app/views/queries/_columns.html.erb index 18443de57..da3ae2acf 100644 --- a/app/views/queries/_columns.html.erb +++ b/app/views/queries/_columns.html.erb @@ -2,36 +2,34 @@ <% available_tag_id = "available_#{tag_id}" %> <% selected_tag_id = "selected_#{tag_id}" %> - - +
<%= label_tag available_tag_id, l(:description_available_columns) %> <%= select_tag 'available_columns', options_for_select(query_available_inline_columns_options(query)), :id => available_tag_id, :multiple => true, :size => 10, :ondblclick => "moveOptions(this.form.#{available_tag_id}, this.form.#{selected_tag_id});" %> - - +
+
- - +
+
<%= label_tag selected_tag_id, l(:description_selected_columns) %> <%= select_tag tag_name, options_for_select(query_selected_inline_columns_options(query)), :id => selected_tag_id, :multiple => true, :size => 10, :ondblclick => "moveOptions(this.form.#{selected_tag_id}, this.form.#{available_tag_id});" %> - - +
+
- - +
<%= javascript_tag do %> $(document).ready(function(){ diff --git a/app/views/queries/_filters.html.erb b/app/views/queries/_filters.html.erb index cb95df1c8..42756775a 100644 --- a/app/views/queries/_filters.html.erb +++ b/app/views/queries/_filters.html.erb @@ -14,8 +14,8 @@ $(document).ready(function(){ }); <% end %> - -
+
+
<%= label_tag('add_filter_select', l(:label_filter_add)) %> diff --git a/app/views/queries/_query_form.html.erb b/app/views/queries/_query_form.html.erb index 87e455bd6..f60fa7911 100644 --- a/app/views/queries/_query_form.html.erb +++ b/app/views/queries/_query_form.html.erb @@ -17,36 +17,36 @@
<% end %> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index e866b505a..c1b5d580d 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -127,10 +127,10 @@ function initFilters() { $('#add_filter_select').change(function() { addFilter($(this).val(), '', []); }); - $('#filters-table td.field input[type=checkbox]').each(function() { + $('#filters-table .field input[type=checkbox]').each(function() { toggleFilter($(this).val()); }); - $('#filters-table').on('click', 'td.field input[type=checkbox]', function() { + $('#filters-table').on('click', '.field input[type=checkbox]', function() { toggleFilter($(this).val()); }); $('#filters-table').on('keypress', 'input[type=text]', function(e) { @@ -177,14 +177,14 @@ function buildFilterRow(field, operator, values) { var filterValues = filterOptions['values']; var i, select; - var tr = $('').attr('id', 'tr_'+fieldId).html( - '' + - '' + + '
' + + '
' ); filterTable.append(tr); - select = tr.find('td.operator select'); + select = tr.find('.operator select'); for (i = 0; i < operators.length; i++) { var option = $('