Loading client/src/components/History/Modals/SelectorModal.vue +16 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ :per-page="perPage" :current-page="currentPage" :selectable="true" :sort-by.sync="sortBy" :sort-desc.sync="sortDesc" :sort-compare="currentFirstSortCompare" select-mode="single" selected-variant="success" @row-selected="switchToHistory" Loading Loading @@ -58,6 +61,8 @@ export default { filter: null, currentPage: 1, totalRows: 0, sortBy: "update_time", sortDesc: true, }; }, computed: { Loading Loading @@ -92,6 +97,17 @@ export default { this.totalRows = filteredItems.length; this.currentPage = 1; }, /** Make the current history appear always first when sorting. */ currentFirstSortCompare(a, b, key, sortDesc) { if (a.id == this.currentHistoryId) { return sortDesc ? 1 : -1; } else if (b.id == this.currentHistoryId) { return sortDesc ? -1 : 1; } else { // Fallback to default sorting return false; } }, }, }; </script> Loading
client/src/components/History/Modals/SelectorModal.vue +16 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ :per-page="perPage" :current-page="currentPage" :selectable="true" :sort-by.sync="sortBy" :sort-desc.sync="sortDesc" :sort-compare="currentFirstSortCompare" select-mode="single" selected-variant="success" @row-selected="switchToHistory" Loading Loading @@ -58,6 +61,8 @@ export default { filter: null, currentPage: 1, totalRows: 0, sortBy: "update_time", sortDesc: true, }; }, computed: { Loading Loading @@ -92,6 +97,17 @@ export default { this.totalRows = filteredItems.length; this.currentPage = 1; }, /** Make the current history appear always first when sorting. */ currentFirstSortCompare(a, b, key, sortDesc) { if (a.id == this.currentHistoryId) { return sortDesc ? 1 : -1; } else if (b.id == this.currentHistoryId) { return sortDesc ? -1 : 1; } else { // Fallback to default sorting return false; } }, }, }; </script>