Skip to content

Commit

Permalink
Change delete icon in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsumi-sama committed Oct 9, 2024
1 parent f691302 commit bbf1115
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11156,25 +11156,29 @@ speechSynthesis.getVoices();
this.addGameLogEntry(gameLog, this.lastLocation.location);
};

$app.methods.deleteGameLogEntry = function (row) {
$app.methods.deleteGameLogEntryPrompt = function (row) {
this.$confirm('Continue? Delete Log', 'Confirm', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'info',
callback: (action) => {
if (action === 'confirm') {
removeFromArray(this.gameLogTable.data, row);
database.deleteGameLogEntry(row);
console.log(row);
database.getGamelogDatabase().then((data) => {
this.gameLogSessionTable = data;
this.updateSharedFeed(true);
});
this.deleteGameLogEntry(row);
}
}
});
};

$app.methods.deleteGameLogEntry = function (row) {
removeFromArray(this.gameLogTable.data, row);
database.deleteGameLogEntry(row);
console.log(row);
database.getGamelogDatabase().then((data) => {
this.gameLogSessionTable = data;
this.updateSharedFeed(true);
});
};

$app.data.lastLocationDestination = '';
$app.data.lastLocationDestinationTime = 0;
$app.data.lastVideoUrl = '';
Expand Down
2 changes: 1 addition & 1 deletion html/src/mixins/tabs/friendLog.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ mixin friendLogTab()
span ({{ scope.row.previousTrustLevel }} #[i.el-icon-right] {{ scope.row.trustLevel }})
el-table-column(:label="$t('table.friendLog.action')" width="80" align="right")
template(v-once #default="scope")
el-button(type="text" icon="el-icon-close" size="mini" @click="deleteFriendLog(scope.row)")
el-button(type="text" icon="el-icon-delete" size="mini" @click="deleteFriendLog(scope.row)")
2 changes: 1 addition & 1 deletion html/src/mixins/tabs/gameLog.pug
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ mixin gameLogTab()
span.x-link(v-else v-text="scope.row.data")
el-table-column(:label="$t('table.gameLog.action')" width="80" align="right")
template(v-once #default="scope")
el-button(v-if="scope.row.type !== 'OnPlayerJoined' && scope.row.type !== 'OnPlayerLeft' && scope.row.type !== 'Location' && scope.row.type !== 'PortalSpawn'" type="text" icon="el-icon-close" size="mini" @click="deleteGameLogEntry(scope.row)")
el-button(v-if="scope.row.type !== 'OnPlayerJoined' && scope.row.type !== 'OnPlayerLeft' && scope.row.type !== 'Location' && scope.row.type !== 'PortalSpawn'" type="text" icon="el-icon-delete" size="mini" @click="deleteGameLogEntryPrompt(scope.row)")
el-tooltip(placement="top" content="Open Instance Info" :disabled="hideTooltips")
el-button(v-if="scope.row.type === 'Location'" type="text" icon="el-icon-tickets" size="mini" @click="showPreviousInstanceInfoDialog(scope.row.location)")

0 comments on commit bbf1115

Please sign in to comment.