Defect #34834

Line breaks in the description of a custom field are ignored in a tooltip

Added by Go MAEDA 8 months ago. Updated 17 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:UI
Target version:4.1.5
Resolution:Fixed Affected version:4.1.0

Description

The text in the description field of a custom field is displayed as a tooltip. In Redmine 4.1, all line breaks in the descriptions are ignored when showing a tooltip.

Redmine 4.1:

Redmine 4.0:

tooltip-4_1.png (28.3 KB) Go MAEDA, 2021-03-04 07:57

tooltip-4_0.png (36.9 KB) Go MAEDA, 2021-03-04 07:57

cf-description.png (38 KB) Go MAEDA, 2021-03-04 07:58

tooltip-after-patching.png (33.9 KB) Yuichi HARADA, 2021-09-09 02:48

34834.patch Magnifier (442 Bytes) Yuichi HARADA, 2021-09-09 02:48


Related issues

Related to Redmine - Patch #31441: Show elements titles using jQuery UI tooltips Closed

Associated revisions

Revision 21222
Added by Go MAEDA 23 days ago

Line breaks in the description of a custom field are ignored in a tooltip (#34834).

Patch by Yuichi HARADA.

Revision 21223
Added by Go MAEDA 17 days ago

Merged r21222 from trunk to 4.2-stable (#34834).

Revision 21224
Added by Go MAEDA 17 days ago

Merged r21222 from trunk to 4.1-stable (#34834).

History

#1 Updated by Go MAEDA 8 months ago

  • Related to Patch #31441: Show elements titles using jQuery UI tooltips added

#2 Updated by Yuuki NARA 7 months ago

By specifying content instead of title in tooltip, it was possible to reflect including line breaks.
I'm not used to JQuely, so I would appreciate it if you could fix any problems.

public/javascripts/application.js

$(function () {
  $("[title]:not(.no-tooltip)").tooltip({
+    content: function() {
+      return $(title)
+    },
    show: {
      delay: 400
    },
    position: {
      my: "center bottom-5",
      at: "center top" 
    }
  });
});

#3 Updated by Yuichi HARADA about 1 month ago

Line breaks will be reflected in a tooltip by using the following patch.

diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 9f6b4dc3d7..791ef4c23d 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -1493,7 +1493,8 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container {
   color: #fff;
   border-radius: 3px;
   border: 0;
-  box-shadow: none
+  box-shadow: none;
+  white-space: pre-wrap;
 }

 /***** Icons *****/

Redmine-trunk: (r21217)

#4 Updated by Go MAEDA 23 days ago

  • Target version set to 4.1.5

Setting the target version to 4.1.5.

#5 Updated by Go MAEDA 23 days ago

  • Subject changed from Line breaks in the description field of custom fields are ignored to Line breaks in the description of a custom field are ignored in a tooltip
  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

#6 Updated by Go MAEDA 17 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF