display only style name in the editor tab title
"Edit Style" was redundant and made the title unreadable when many tabs were opened. "Add Style" is still displayed for the new styles.
This commit is contained in:
parent
1b7c131c37
commit
eff0a7030c
|
@ -406,11 +406,10 @@ function validate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTitle() {
|
function updateTitle() {
|
||||||
const DIRTY_TITLE = '* $';
|
|
||||||
const name = $('#name').savedValue;
|
const name = $('#name').savedValue;
|
||||||
const clean = isCleanGlobal();
|
const clean = isCleanGlobal();
|
||||||
const title = styleId === null ? t('addStyleTitle') : t('editStyleTitle', [name]);
|
const title = styleId === null ? t('addStyleTitle') : name;
|
||||||
document.title = clean ? title : DIRTY_TITLE.replace('$', title);
|
document.title = (clean ? '' : '* ') + title;
|
||||||
window.onbeforeunload = clean ? null : beforeUnload;
|
window.onbeforeunload = clean ? null : beforeUnload;
|
||||||
$('#save-button').disabled = clean;
|
$('#save-button').disabled = clean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ function createSourceEditor(style) {
|
||||||
|
|
||||||
function updateTitle() {
|
function updateTitle() {
|
||||||
const newTitle = (dirty.isDirty() ? '* ' : '') +
|
const newTitle = (dirty.isDirty() ? '* ' : '') +
|
||||||
(style.id ? t('editStyleTitle', [style.name]) : t('addStyleTitle'));
|
(style.id ? style.name : t('addStyleTitle'));
|
||||||
if (document.title !== newTitle) {
|
if (document.title !== newTitle) {
|
||||||
document.title = newTitle;
|
document.title = newTitle;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user