Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Fix sort arrow icon classes #110

Merged
merged 2 commits into from
May 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/dist/client.84d95696.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/dist/client.ba80e24e.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

<script src="//unpkg.com/jquery@2.1.4/dist/jquery.min.js"></script>
<script src="//unpkg.com/bootstrap@3.3.5/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="client.ba80e24e.js"></script></body>
<script type="text/javascript" src="client.84d95696.js"></script></body>
</html>
7 changes: 5 additions & 2 deletions src/Table/HeadSort.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ export default {
cls () {
return [
'fa',
`fa-sort-${this.order}`.replace(/-$/, ''),
{ 'text-muted': !this.order }
{ 'fa-sort': !this.order,
'fa-sort-up': this.order === 'asc',
'fa-sort-down': this.order === 'desc',
'text-muted': !this.order
}
]
}
},
Expand Down
8 changes: 4 additions & 4 deletions test/Basic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ test('sort', async t => {
vm.query
)
await nextTick()
t.true(uidSort.hasClass('fa-sort-desc'))
t.true(uidSort.hasClass('fa-sort-down'))

ageSortBtn.trigger('click')
t.deepEqual(
{ limit: 10, offset: 0, sort: 'age', order: 'desc' },
vm.query
)
await nextTick()
t.true(ageSort.hasClass('fa-sort-desc'))
t.true(ageSort.hasClass('fa-sort-down'))

ageSortBtn.trigger('click')
t.deepEqual(
Expand All @@ -62,12 +62,12 @@ test('sort', async t => {
)
await nextTick()
await nextTick()
t.true(ageSort.hasClass('fa-sort-asc'))
t.true(ageSort.hasClass('fa-sort-up'))

/* *** programmatic behavior *** */
Object.assign(vm.query, { sort: 'uid', order: 'asc' })
await nextTick()
t.true(uidSort.hasClass('fa-sort-asc'))
t.true(uidSort.hasClass('fa-sort-up'))
})

test('pagination relevant', async t => {
Expand Down