diff --git a/app/views/enhanced_ux/gantts/_custom_gantt_chart.html.erb b/app/views/enhanced_ux/gantts/_custom_gantt_chart.html.erb index 0cd53e5..b8e0aae 100644 --- a/app/views/enhanced_ux/gantts/_custom_gantt_chart.html.erb +++ b/app/views/enhanced_ux/gantts/_custom_gantt_chart.html.erb @@ -180,10 +180,10 @@ function ajaxPostProcess(htmlString) { const data = new DOMParser().parseFromString(htmlString, "text/html"); + const $headData = $("head", data); // Execute actual dates plugin startup script try { - const $headData = $("head", data); const scriptActualDates = $headData .filter((i, e) => e.nodeName === "SCRIPT") .map((i, e) => $(e).text()) @@ -229,7 +229,11 @@ e.nodeValue = $("#content>h2", htmlString).text(); } }); - $("head>title").text($("title", htmlString).text()); + + // Update page title + // Note: The cause is unknown, Failed to extract title using + // `$("title", htmlString)` + $("head>title").text($headData.find("title").text()); // Update sidebar $("#sidebar").replaceWith($("#sidebar", htmlString)); diff --git a/app/views/enhanced_ux/issue_note_list/_custom_issue_note_list.html.erb b/app/views/enhanced_ux/issue_note_list/_custom_issue_note_list.html.erb index e1f77d6..e4a23c6 100644 --- a/app/views/enhanced_ux/issue_note_list/_custom_issue_note_list.html.erb +++ b/app/views/enhanced_ux/issue_note_list/_custom_issue_note_list.html.erb @@ -110,6 +110,7 @@ // Data acquisition and processing const htmlString = await response.text(); + const data = new DOMParser().parseFromString(htmlString, "text/html"); if (url !== location.href) { // Update history @@ -162,6 +163,11 @@ .append($("table.list.issues", htmlString).children()); IssueNoteList.fn.initialize(); + // Update page title + // Note: The cause is unknown, Failed to extract title using + // `$("title", htmlString)` + $("head>title").text($("head>title", data).text()); + // Set form state IssueNoteList.fn.collapseNoteRow( "all", diff --git a/app/views/enhanced_ux/issues/_custom_issue_list.html.erb b/app/views/enhanced_ux/issues/_custom_issue_list.html.erb index 683163f..cfdf641 100644 --- a/app/views/enhanced_ux/issues/_custom_issue_list.html.erb +++ b/app/views/enhanced_ux/issues/_custom_issue_list.html.erb @@ -168,6 +168,7 @@ // Data acquisition and processing const htmlString = await response.text(); + const data = new DOMParser().parseFromString(htmlString, "text/html"); if (url !== location.href) { // Update history @@ -203,7 +204,11 @@ e.nodeValue = $("#content>h2", htmlString).text(); } }); - $("head>title").text($("title", htmlString).text()); + + // Update page title + // Note: The cause is unknown, Failed to extract title using + // `$("title", htmlString)` + $("head>title").text($("head>title", data).text()); // Update sidebar $("#sidebar").replaceWith($("#sidebar", htmlString));