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

@@ -1,4 +1,4 @@
APP_VERSION="DEV 0.0.32"
APP_VERSION="DEV 0.0.33"
SERVICE_WORKER_FILE='service-worker.js'
APP_ID='1'
APP_URL='https://freeplanet.app'

View File

@@ -48,7 +48,7 @@ $heightdescr: 20px;
border-width: 1px 0px 1px 0px;
border-style: solid;
border-color: rgba(49, 68, 240, 0.6);
//background-color: rgba(166, 153, 240, 0.7) !important;
background-color: rgba(83, 132, 250, 0.44) !important;
}
@@ -218,7 +218,7 @@ $heightdescr: 20px;
}
.data-item {
max-width: 80px;
max-width: 85px;
//min-width: 100px;
//display: flex;
//visibility: initial;
@@ -246,19 +246,27 @@ $heightdescr: 20px;
}
*/
.divdescrTot {
display: table;
flex: 1;
height: $heightitem;
vertical-align: middle;
}
.div_descr, .div_descr_edit {
margin: auto auto auto 2px;
margin: auto auto auto 0px;
//padding: 2px;
min-width: 100px;
vertical-align: middle;
text-align: left;
color: blue !important;
max-height: 42px;
overflow: hidden;
flex: 1;
vertical-align: middle;
line-height: 120%;
//background-color: #d50000;
//order: 2;
line-height: $heightdescr; /* same as height! */
&.hide {
display: none !important;
@@ -269,9 +277,15 @@ $heightdescr: 20px;
}
}
.div_descr {
display: table-cell;
}
.div_descr_edit {
max-height: 90px;
line-height: $heightitem;
}
.div_descr:hover {

View File

@@ -95,7 +95,7 @@ export default class SingleTodo extends Vue {
// this.classCompleted = 'completed-item'
this.classCompleted = 'completed-item-popover'
this.classDescr = 'flex-item div_descr show donotdrag'
this.classDescrEdit = 'flex-item div_descr_edit'
this.classDescrEdit = 'flex-item div_descr_edit donotdrag'
if (!this.isTodo()) {
this.classDescr += ' titleLista-item'
this.classDescrEdit += ' titleLista-item'

View File

@@ -2,9 +2,9 @@
<div :class="getClassRow()" @click="clickRow">
<div v-if="isTodo()" class="flex-item counter-item dragula-container">{{itemtodo.pos}}</div>
<!--<div v-if="isFirst">-->
<!--<q-context-menu ref="contextMenu">-->
<!--<SubMenus :menuPopupTodo="menuPopupTodo" :itemtodo="itemtodo" @clickMenu="clickMenu" @setPriority="setPriority"></SubMenus>-->
<!--</q-context-menu>-->
<!--<q-context-menu ref="contextMenu">-->
<!--<SubMenus :menuPopupTodo="menuPopupTodo" :itemtodo="itemtodo" @clickMenu="clickMenu" @setPriority="setPriority"></SubMenus>-->
<!--</q-context-menu>-->
<!--</div>-->
<div v-if="isTodo()" class="flex-item completed-item">
@@ -15,16 +15,21 @@
</q-btn>
</div>
<q-input v-if="sel && !itemtodo.completed" hide-underline type="textarea" ref="inputdescr" v-model.trim="precDescr"
:class="classDescrEdit" :max-height="100"
@keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editTodo()"/>
<div class="flex-item donotdrag divdescrTot">
<q-input v-if="sel && !itemtodo.completed" hide-underline type="textarea" ref="inputdescr"
v-model.trim="precDescr"
:class="classDescrEdit" :max-height="100"
@keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editTodo()"/>
<div v-else :class="classDescr"
@keydown="keyDownRow">{{itemtodo.descr}}</div>
<div v-else :class="classDescr"
@keydown="keyDownRow">{{itemtodo.descr}}
</div>
</div>
<!--<q-field dark v-else :label="itemtodo.descr"-->
<!--:class="classDescr"-->
<!--@keydown="keyDownRow"></q-field>-->
<!--:class="classDescr"-->
<!--@keydown="keyDownRow"></q-field>-->
<!--:after="[{icon: 'arrow_forward', content: true, handler () {}}]"-->
@@ -42,7 +47,7 @@
<div :class="percProgress">
{{percentageProgress}}%
<q-popup-edit v-model="itemtodo.progress" title="Progress" buttons class="editProgress">
<q-input type="number" v-model="itemtodo.progress" :max="100" :min="0" />
<q-input type="number" v-model="itemtodo.progress" :max="100" :min="0"/>
</q-popup-edit>
</div>
@@ -55,16 +60,17 @@
v-model="itemtodo.expiring_at"
class="myexpired"
format="DD/MM/YY"
@change="val => { model = val }" >
@change="val => { model = val }">
</q-datetime>
</div>
<div v-if="isTodo()" class="flex-item pos-item item-drag " @mouseup.left="mouseUp" @mousedown="clickRiga">
<div v-if="isTodo()" class="flex-item pos-item " @mouseup.left="mouseUp" @mousedown="clickRiga">
<q-btn push
:class="clButtPopover"
icon="menu" >
icon="menu">
<q-popover v-if="sel" self="top right">
<SubMenus :menuPopupTodo="menuPopupTodo" :itemtodo="itemtodo" @clickMenu="clickMenu" @setPriority="setPriority"></SubMenus>
<SubMenus :menuPopupTodo="menuPopupTodo" :itemtodo="itemtodo" @clickMenu="clickMenu"
@setPriority="setPriority"></SubMenus>
</q-popover>
</q-btn>

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]

View File

@@ -23,9 +23,9 @@
<small>- Small</small>
</footer>-->
<div class="fixed-bottom text-center light text-italic">
Powered by Perseo
</div>
<!--<div class="fixed-bottom text-center light text-italic">-->
<!--Powered by Perseo-->
<!--</div>-->
</div>
</template>