fix: problem scrolling with touch... sometimes dragged... and it should't do it

This commit is contained in:
Paolo Arena
2019-02-20 20:59:18 +01:00
parent c77fe5b2f9
commit 1623a5c35d
6 changed files with 74 additions and 27 deletions

View File

@@ -52,6 +52,7 @@ export default class Todo extends Vue {
public itemdrag: any = {}
public service: any
public actualMaxPosition: number = 15
public scrollable = true
fieldtochange: String [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'id_next', 'pos', 'enableExpiring', 'progress']
@@ -444,9 +445,35 @@ export default class Todo extends Vue {
this.onEnd(itemdragend)
})
let mythis = this
$service.eventBus.$on('drag', function (el, source) {
console.log('+++ DRAG')
mythis.scrollable = false
})
$service.eventBus.$on('drop', function (el, source) {
console.log('+++ DROP')
mythis.scrollable = true
})
this.load()
}
mounted() {
let mythis = this
if (window) {
window.addEventListener('touchmove', function (e) {
console.log('touchmove')
if (!mythis.scrollable) {
e.preventDefault()
}
}, { passive: false })
}
}
setarrPriority() {
this.arrPrior = []
const arr = rescodes.selectPriority[UserStore.state.lang]