From eff0a7030c54ff87152f8b82940cb8d498a76647 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 7 Aug 2018 19:56:24 +0300 Subject: [PATCH] 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. --- edit/edit.js | 5 ++--- edit/source-editor.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index f19225dd..45c6b555 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -406,11 +406,10 @@ function validate() { } function updateTitle() { - const DIRTY_TITLE = '* $'; const name = $('#name').savedValue; const clean = isCleanGlobal(); - const title = styleId === null ? t('addStyleTitle') : t('editStyleTitle', [name]); - document.title = clean ? title : DIRTY_TITLE.replace('$', title); + const title = styleId === null ? t('addStyleTitle') : name; + document.title = (clean ? '' : '* ') + title; window.onbeforeunload = clean ? null : beforeUnload; $('#save-button').disabled = clean; } diff --git a/edit/source-editor.js b/edit/source-editor.js index 70247027..90fc6106 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -149,7 +149,7 @@ function createSourceEditor(style) { function updateTitle() { const newTitle = (dirty.isDirty() ? '* ' : '') + - (style.id ? t('editStyleTitle', [style.name]) : t('addStyleTitle')); + (style.id ? style.name : t('addStyleTitle')); if (document.title !== newTitle) { document.title = newTitle; }