Project

General

Profile

Actions

Defect #41822

open

First icon on the Activity page is replaced with chevrons-left or chevrons-right in responsive mode

Added by Mizuki ISHIKAWA 1 day ago. Updated 1 day ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI - Responsive
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When viewing the Activity page in responsive mode (with a narrowed screen width), the first icon displayed on the page is replaced by either a chevrons-left or chevrons-right icon.
This issue likely occurs because the logic for setting up the sidebar icons runs even when the sidebar is not present in responsive mode. https://github.com/redmine/redmine/blob/master/app/assets/javascripts/application.js#L1292-L1300

In the following screenshot, the chevrons-right icon is displayed where the issue icon should normally appear:


Files

Actions #1

Updated by Mizuki ISHIKAWA 1 day ago

This phenomenon seems to occur on all pages with sidebars, not just activity page.

Actions #2

Updated by Mizuki ISHIKAWA 1 day ago

The problem can be resolved by clearly specifying the target of the changes, as shown in the following diff:

diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 068ac98d8..eb52eb701 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -1291,10 +1291,10 @@ function inlineAutoComplete(element) {
   };
   var applyState = function(){
     if(main.hasClass('collapsedsidebar')){
-      updateSVGIcon(main[0], 'chevrons-left')
+      updateSVGIcon(document.getElementById('sidebar-switch-button'), 'chevrons-left')
       setState('hidden');
     } else {
-      updateSVGIcon(main[0], 'chevrons-right')
+      updateSVGIcon(document.getElementById('sidebar-switch-button'), 'chevrons-right')
       setState('visible');
     }
   };

Actions

Also available in: Atom PDF