actually use the name when saving

This commit is contained in:
tophf 2017-12-03 20:32:50 +03:00
parent 0f3ddb9c03
commit f4677a7b7b
2 changed files with 4 additions and 1 deletions

View File

@ -238,6 +238,9 @@ function getStyles(options) {
cachedStyles.byId.clear(); cachedStyles.byId.clear();
for (const style of cachedStyles.list) { for (const style of cachedStyles.list) {
cachedStyles.byId.set(style.id, style); cachedStyles.byId.set(style.id, style);
if (!style.name) {
style.name = 'ID: ' + style.id;
}
} }
cachedStyles.mutex.inProgress = false; cachedStyles.mutex.inProgress = false;

View File

@ -387,7 +387,7 @@ function save() {
saveStyleSafe({ saveStyleSafe({
id: styleId, id: styleId,
name: name, name: $('#name').value.trim(),
enabled: $('#enabled').checked, enabled: $('#enabled').checked,
reason: 'editSave', reason: 'editSave',
sections: getSectionsHashes() sections: getSectionsHashes()