Vote #81293
完了Line breaks in the description of a custom field are ignored in a tooltip
0%
説明
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.
!{width: 543px; border: 1px solid #ccc;}.cf-description.png!
Redmine 4.1:
!{width: 390px; border: 1px solid #ccc;}.tooltip-4_1.png!
Redmine 4.0:
!{width: 390px; border: 1px solid #ccc;}.tooltip-4_0.png!
journals
--------------------------------------------------------------------------------
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
<pre>
$(function () {
$("[title]:not(.no-tooltip)").tooltip({
+ content: function() {
+ return $(title)
+ },
show: {
delay: 400
},
position: {
my: "center bottom-5",
at: "center top"
}
});
});
</pre>
--------------------------------------------------------------------------------
Line breaks will be reflected in a tooltip by using the following patch.
<pre><code class="diff">
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 *****/
</code></pre>
*Redmine-trunk:* (r21217)
!{width:390px;border:1px solid grey;}tooltip-after-patching.png!
--------------------------------------------------------------------------------
Setting the target version to 4.1.5.
--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,Closed,31441,Show elements titles using jQuery UI tooltips