@ -43,7 +43,11 @@
function sort(direction, column) {
function sort(direction, column) {
backendUiStore.update(state => {
backendUiStore.update(state => {
state.sort = { direction , column }
if (direction !== "none") {
state.sort = { direction , column }
} else {
state.sort = undefined
}
return state
return state
})
})
hideEditor()
hideEditor()
@ -70,6 +74,12 @@
< Icon name = "delete" / >
< Icon name = "delete" / >
Delete
Delete
< / li >
< / li >
{ #if sortDirection === 'desc' || sortDirection === 'asc' }
< li on:click = {() => sort ( 'none' , field . name )} >
< Icon name = "close" / >
Remove sort
< / li >
{ /if }
{ #if sortDirection === 'desc' || sortColumn !== field . name }
{ #if sortDirection === 'desc' || sortColumn !== field . name }
< li on:click = {() => sort ( 'asc' , field . name )} >
< li on:click = {() => sort ( 'asc' , field . name )} >
< Icon name = "sortascending" / >
< Icon name = "sortascending" / >