Skip to content

Commit

Permalink
fix startColor in tag color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
averrin committed Jul 14, 2022
1 parent ecf34a8 commit 637fffe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/view/MainUI.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@
position.scale = game.settings.get(moduleId, SETTINGS.UI_SCALE);
let pickerOpen = false;
let startColor;
let editTag;
function onTagClick(e, tag) {
editTag = tag;
pickerOpen = !pickerOpen;
tagColors.update((tagColors) => {
startColor = editTag && editTag in tagColors ? tagColors[editTag].slice(0, 7) : "#232323";
pickerOpen = !pickerOpen;
return tagColors;
});
}
function createAction(_, tags) {
Expand Down Expand Up @@ -59,8 +64,6 @@
mode = t.mode;
globalThis.game.settings.set(moduleId, SETTINGS.SELECTED_TAB, mode);
}
let startColor = editTag && editTag in tagColors ? tagColors[editTag] : "#232323";
</script>

<input type="checkbox" id="color-modal" class="ui-modal-toggle" bind:checked={pickerOpen} />
Expand Down

0 comments on commit 637fffe

Please sign in to comment.