mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4427 from node-red/4394-update-page-title-on-flow-nav
Update browser title with flow name if set
This commit is contained in:
commit
74d431ea36
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
RED.workspaces = (function() {
|
RED.workspaces = (function() {
|
||||||
|
|
||||||
|
const documentTitle = document.title;
|
||||||
|
|
||||||
var activeWorkspace = 0;
|
var activeWorkspace = 0;
|
||||||
var workspaceIndex = 0;
|
var workspaceIndex = 0;
|
||||||
|
|
||||||
@ -339,12 +341,18 @@ RED.workspaces = (function() {
|
|||||||
$("#red-ui-workspace-chart").show();
|
$("#red-ui-workspace-chart").show();
|
||||||
activeWorkspace = tab.id;
|
activeWorkspace = tab.id;
|
||||||
window.location.hash = 'flow/'+tab.id;
|
window.location.hash = 'flow/'+tab.id;
|
||||||
|
if (tab.label) {
|
||||||
|
document.title = `${documentTitle} : ${tab.label}`
|
||||||
|
} else {
|
||||||
|
document.title = documentTitle
|
||||||
|
}
|
||||||
$("#red-ui-workspace").toggleClass("red-ui-workspace-disabled", !!tab.disabled);
|
$("#red-ui-workspace").toggleClass("red-ui-workspace-disabled", !!tab.disabled);
|
||||||
$("#red-ui-workspace").toggleClass("red-ui-workspace-locked", !!tab.locked);
|
$("#red-ui-workspace").toggleClass("red-ui-workspace-locked", !!tab.locked);
|
||||||
} else {
|
} else {
|
||||||
$("#red-ui-workspace-chart").hide();
|
$("#red-ui-workspace-chart").hide();
|
||||||
activeWorkspace = 0;
|
activeWorkspace = 0;
|
||||||
window.location.hash = '';
|
window.location.hash = '';
|
||||||
|
document.title = documentTitle
|
||||||
}
|
}
|
||||||
event.workspace = activeWorkspace;
|
event.workspace = activeWorkspace;
|
||||||
RED.events.emit("workspace:change",event);
|
RED.events.emit("workspace:change",event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user