mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-04-29 21:41:08 +08:00
fixed a bug where asdf would be visible instead of the actual tags
refreshing the tags list when edited or added new ones
This commit is contained in:
parent
d0daa37cc4
commit
a93ba0027c
3 changed files with 12 additions and 8 deletions
public
|
@ -44,8 +44,7 @@
|
|||
<div id="resultEditTagsPanelWrapper" class="hidden">
|
||||
<div id="resultEditTagsPanel" resultid="">
|
||||
<div class="buttons">
|
||||
<div class="button tag">asdf</div>
|
||||
<div class="button active tag">asdf</div>
|
||||
|
||||
</div>
|
||||
<div class="button confirmButton"><i class="fas fa-check"></i></div>
|
||||
</div>
|
||||
|
|
|
@ -886,12 +886,14 @@ function hideResultEditTagsPanel(){
|
|||
}
|
||||
|
||||
$(document).on('click','.pageAccount .group.history #resultEditTags',f => {
|
||||
let resultid = $(f.target).parents('span').attr('resultid');
|
||||
let tags = $(f.target).parents('span').attr('tags');
|
||||
$("#resultEditTagsPanel").attr('resultid',resultid);
|
||||
$("#resultEditTagsPanel").attr('tags',tags);
|
||||
updateActiveResultEditTagsPanelButtons(JSON.parse(tags));
|
||||
showResultEditTagsPanel();
|
||||
if(dbSnapshot.tags.length > 0){
|
||||
let resultid = $(f.target).parents('span').attr('resultid');
|
||||
let tags = $(f.target).parents('span').attr('tags');
|
||||
$("#resultEditTagsPanel").attr('resultid',resultid);
|
||||
$("#resultEditTagsPanel").attr('tags',tags);
|
||||
updateActiveResultEditTagsPanelButtons(JSON.parse(tags));
|
||||
showResultEditTagsPanel();
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('click','#resultEditTagsPanelWrapper .button.tag',f => {
|
||||
|
|
|
@ -1481,6 +1481,7 @@ function tagsEdit(){
|
|||
hideBackgroundLoader();
|
||||
let status = e.data.resultCode;
|
||||
if(status === 1){
|
||||
updateResultEditTagsPanelButtons();
|
||||
showNotification('Tag added',2000);
|
||||
dbSnapshot.tags.push({
|
||||
name: inputVal,
|
||||
|
@ -1500,6 +1501,7 @@ function tagsEdit(){
|
|||
hideBackgroundLoader();
|
||||
let status = e.data.resultCode;
|
||||
if(status === 1){
|
||||
updateResultEditTagsPanelButtons();
|
||||
showNotification('Tag updated',2000);
|
||||
dbSnapshot.tags.forEach(tag => {
|
||||
if(tag.id === tagid){
|
||||
|
@ -1520,6 +1522,7 @@ function tagsEdit(){
|
|||
hideBackgroundLoader();
|
||||
let status = e.data.resultCode;
|
||||
if(status === 1){
|
||||
updateResultEditTagsPanelButtons();
|
||||
showNotification('Tag removed',2000);
|
||||
dbSnapshot.tags.forEach((tag,index) => {
|
||||
if(tag.id === tagid){
|
||||
|
|
Loading…
Add table
Reference in a new issue