Use alphabetical sorting
onTagColorize2(evt));
}
-function toggleAutoSortTags(toggle) {
+/**
+ * Print the list of tags in the tag management view
+ * @param {Event} event Event that triggered the color change
+ * @param {boolean} toggle State of the toggle
+ */
+function toggleAutoSortTags(event, toggle) {
if (toggle === power_user.auto_sort_tags) return;
// Ask user to confirm if enabling and it was manually sorted before
if (toggle && isManuallySorted() && !confirm('Are you sure you want to automatically sort alphabetically?')) {
+ if (event.target instanceof HTMLInputElement) {
+ event.target.checked = false;
+ }
return;
}
@@ -1456,7 +1464,7 @@ export function initTags() {
$(document).on('input', '#dialogue_popup input[name="auto_sort_tags"]', (evt) => {
const toggle = $(evt.target).is(':checked');
- toggleAutoSortTags(toggle);
+ toggleAutoSortTags(evt.originalEvent, toggle);
printViewTagList();
});
$(document).on('focusout', `#dialogue_popup .tag_view_name`, (evt) => {