Skip to content

Commit

Permalink
feat(order): Add material ripple effect to item list #82
Browse files Browse the repository at this point in the history
  • Loading branch information
hecsalazarf committed Jan 1, 2020
1 parent 5d18019 commit ed3f4b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/components/customer/ContactItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<q-item
v-ripple
clickable
@click="$router.push({name: $options.routes.customerDetails, params: { id: value.id }})"
@click="handleClick"
>
<q-item-section avatar>
<q-avatar
Expand All @@ -29,6 +29,7 @@
</template>

<script>
import { debounce } from 'quasar'
import { RouteNames } from 'src/constants/app'
export default {
name: 'HContactItem',
Expand Down Expand Up @@ -57,6 +58,11 @@ export default {
} else return `${this.value.name1} ${this.value.lastName1}`
}
},
methods: {
handleClick: debounce(function (evt) {
this.$router.push({ name: this.$options.routes.customerDetails, params: { id: this.value.id } })
}, 200)
},
routes: {
customerDetails: RouteNames.CUSTOMER_DETAILS
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/order/ListItem.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div>
<q-item
v-ripple
v-touch-hold.mouse="handleHold"
clickable
:active="isActive"
Expand Down Expand Up @@ -53,7 +54,7 @@
</template>

<script>
import { date } from 'quasar'
import { date, debounce } from 'quasar'
import { createNamespacedHelpers } from 'vuex'
import { OrderComponentMixin } from './common'
import { RouteNames } from 'src/constants/app'
Expand Down Expand Up @@ -118,7 +119,7 @@ export default {
handleHold ({ evt, ...info }) {
// this.$refs.selectionEl.toggle() // SELECTION DISABLED (#28)
},
handleClick (evt) {
handleClick: debounce(function (evt) {
if (this.selectedOrders.length > 0) {
this.$refs.selectionEl.toggle()
} else {
Expand All @@ -127,7 +128,7 @@ export default {
params: { id: this.value.id }
})
}
},
}, 200),
...mapActions(['changeSelectedOrders', 'changeActiveToolbar'])
}
}
Expand Down

0 comments on commit ed3f4b5

Please sign in to comment.