🚸 Feat: focus code on unlock edit and blur code on lock edit (#76)

This commit is contained in:
Cell
2022-03-11 21:23:12 +08:00
parent 09b4443df8
commit c90577b6b4
3 changed files with 4 additions and 2 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
View File
@@ -405,11 +405,13 @@ class Theme {
$iconKey.classList.remove('fa-key');
$iconKey.title = this.config.code.editLockTitle;
$preChroma.setAttribute('contenteditable', true);
$preChroma.focus();
} else {
$iconLock.classList.add('fa-key');
$iconLock.classList.remove('fa-lock');
$iconLock.title = this.config.code.editUnLockTitle;
$preChroma.setAttribute('contenteditable', false);
$preChroma.blur();
}
}, false);
$header.appendChild($edit);