Merge pull request #4850 from kazuhitoyokoi/master-fixpagetitle

Refresh page title after changing tab name
pull/4884/head
Nick O'Leary 2024-09-17 14:19:56 +01:00 committed by GitHub
commit 98ca0f163e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -920,6 +920,17 @@ RED.workspaces = (function() {
}
},
refresh: function() {
var workspace = RED.nodes.workspace(RED.workspaces.active());
if (workspace) {
document.title = `${documentTitle} : ${workspace.label}`;
} else {
var subflow = RED.nodes.subflow(RED.workspaces.active());
if (subflow) {
document.title = `${documentTitle} : ${subflow.name}`;
} else {
document.title = documentTitle
}
}
RED.nodes.eachWorkspace(function(ws) {
workspace_tabs.renameTab(ws.id,ws.label);
$("#red-ui-tab-"+(ws.id.replace(".","-"))).attr("flowname",ws.label)