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' SERVICE_WORKER_FILE='service-worker.js'
APP_ID='1' APP_ID='1'
APP_URL='https://freeplanet.app' APP_URL='https://freeplanet.app'

View File

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

View File

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

View File

@@ -15,12 +15,17 @@
</q-btn> </q-btn>
</div> </div>
<q-input v-if="sel && !itemtodo.completed" hide-underline type="textarea" ref="inputdescr" v-model.trim="precDescr" <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" :class="classDescrEdit" :max-height="100"
@keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editTodo()"/> @keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editTodo()"/>
<div v-else :class="classDescr" <div v-else :class="classDescr"
@keydown="keyDownRow">{{itemtodo.descr}}</div> @keydown="keyDownRow">{{itemtodo.descr}}
</div>
</div>
<!--<q-field dark v-else :label="itemtodo.descr"--> <!--<q-field dark v-else :label="itemtodo.descr"-->
<!--:class="classDescr"--> <!--:class="classDescr"-->
@@ -59,12 +64,13 @@
</q-datetime> </q-datetime>
</div> </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 <q-btn push
:class="clButtPopover" :class="clButtPopover"
icon="menu"> icon="menu">
<q-popover v-if="sel" self="top right"> <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-popover>
</q-btn> </q-btn>

View File

@@ -52,6 +52,7 @@ export default class Todo extends Vue {
public itemdrag: any = {} public itemdrag: any = {}
public service: any public service: any
public actualMaxPosition: number = 15 public actualMaxPosition: number = 15
public scrollable = true
fieldtochange: String [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'id_next', 'pos', 'enableExpiring', 'progress'] 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) 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() this.load()
} }
mounted() {
let mythis = this
if (window) {
window.addEventListener('touchmove', function (e) {
console.log('touchmove')
if (!mythis.scrollable) {
e.preventDefault()
}
}, { passive: false })
}
}
setarrPriority() { setarrPriority() {
this.arrPrior = [] this.arrPrior = []
const arr = rescodes.selectPriority[UserStore.state.lang] const arr = rescodes.selectPriority[UserStore.state.lang]

View File

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