Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Commit e5080fe

Browse files
committed
Minor fixes for feature sorting event
1 parent 0bbb445 commit e5080fe

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/components/ServerDatasource.vue

+23-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import DatasourceUtils from '@/utils/DatasourceUtils'
33
import Pagination from './Pagination'
44
import {EventBus} from '@/utils/EventBus'
5-
import IconAsc from '@/assets/icon-asc.png'
6-
import IconDesc from '@/assets/icon-desc.png'
5+
import IconAsc from '@/assets/icon-sort-asc.svg'
6+
import IconDesc from '@/assets/icon-sort-desc.svg'
77
export default {
88
name: 'ServerDatasource',
99
components: {Pagination},
@@ -141,13 +141,17 @@ export default {
141141
},
142142
columnItems () {
143143
let showArrows = (key) => {
144-
return (this.shouldShowUpArrow(key)) ? <img src={IconDesc} width="15"/>
145-
: <img src={IconAsc} width="15"/>
144+
if (this.columnSortSelected.key) {
145+
return (this.shouldShowUpArrow(key)) ? <img class="arrow-active" src={IconAsc} width="15"/>
146+
: <img class="arrow-active" src={IconDesc} width="15"/>
147+
} else {
148+
return <img src={IconDesc} width="15"/>
149+
}
146150
}
147151
148152
return this.columns.map((column, index) => {
149153
if (column.order) {
150-
return <th on-click={(e) => this.sortColumn(e, column.key)}>
154+
return <th class="vue-server-ordering" on-click={(e) => this.sortColumn(e, column.key)}>
151155
{column.name}
152156
<span class="vue-server-arrows">{showArrows(column.key)}</span>
153157
</th>
@@ -231,13 +235,26 @@ export default {
231235
}
232236
.vue-server-arrows {
233237
position: absolute;
234-
right: 0;
238+
right: 5px;
235239
top: 6px;
236240
}
237241
table {
238242
margin-bottom: 0;
239243
th {
240244
position: relative;
245+
246+
&.vue-server-ordering {
247+
cursor: pointer;
248+
249+
.vue-server-arrows {
250+
img {
251+
opacity: .3;
252+
&.arrow-active {
253+
opacity: 1;
254+
}
255+
}
256+
}
257+
}
241258
}
242259
}
243260
.panel-footer {

0 commit comments

Comments
 (0)