mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-01 12:41:36 +02:00
Add endpoints to customize or disable iD's changing of the document title (close #7503)
Use the initial title as the default base title
This commit is contained in:
@@ -58,6 +58,24 @@ export function coreContext() {
|
||||
return context;
|
||||
};
|
||||
|
||||
/* Document title */
|
||||
/* (typically shown as the label for the browser window/tab) */
|
||||
|
||||
// If true, iD will update the title based on what the user is doing
|
||||
let _setsDocumentTitle = true;
|
||||
context.setsDocumentTitle = function(val) {
|
||||
if (!arguments.length) return _setsDocumentTitle;
|
||||
_setsDocumentTitle = val;
|
||||
return context;
|
||||
};
|
||||
// The part of the title that is always the same
|
||||
let _documentTitleBase = document.title;
|
||||
context.documentTitleBase = function(val) {
|
||||
if (!arguments.length) return _documentTitleBase;
|
||||
_documentTitleBase = val;
|
||||
return context;
|
||||
};
|
||||
|
||||
|
||||
/* User interface and keybinding */
|
||||
let _ui;
|
||||
|
||||
Reference in New Issue
Block a user