HomePage Description Project
This commit is contained in:
@@ -238,9 +238,9 @@
|
||||
|
||||
public selectOpLang = [
|
||||
{ label: 'English', icon: 'fa-flag-us', value: 'enUs', image: '../statics/images/gb.png', short: 'EN' },
|
||||
{ label: 'Español', icon: 'fa-flag-es', value: 'esEs', image: '../statics/images/es.png', short: 'ES' },
|
||||
{ label: 'Italiano', icon: 'fa-facebook', value: 'it', image: '../statics/images/it.png', short: 'IT' }
|
||||
// { label: 'German', icon: 'fa-flag-de', value: 'de', image: '../statics/images/de.png', short: 'DE' },
|
||||
{ label: 'Italiano', icon: 'fa-facebook', value: 'it', image: '../statics/images/it.png', short: 'IT' },
|
||||
{ label: 'Español', icon: 'fa-flag-es', value: 'esEs', image: '../statics/images/es.png', short: 'ES' }
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -254,13 +254,12 @@ export default class SingleTodo extends Vue {
|
||||
}
|
||||
|
||||
faiFocus(elem, isparent: boolean = false) {
|
||||
let mythis = this
|
||||
setTimeout(() => {
|
||||
let theField = null
|
||||
if (isparent)
|
||||
theField = <HTMLInputElement>mythis.$parent.$parent.$parent.$parent.$refs[elem]
|
||||
theField = <HTMLInputElement>this.$parent.$parent.$parent.$parent.$refs[elem]
|
||||
else
|
||||
theField = <HTMLInputElement>mythis.$refs[elem]
|
||||
theField = <HTMLInputElement>this.$refs[elem]
|
||||
|
||||
if (theField !== undefined)
|
||||
theField.focus()
|
||||
|
||||
@@ -156,39 +156,6 @@ export default class Todo extends Vue {
|
||||
return 'elem [' + elem._id + '] ' + elem.descr + ' Pr(' + this.getPriorityByInd(elem.priority) + ') [ID_PREV=' + elem.id_prev + '] modif=' + elem.modified + ' '
|
||||
}
|
||||
|
||||
// getPriorityToSet(ind1, ind2) {
|
||||
// let elem1 = this.getelem(ind1)
|
||||
// let elem2 = this.getelem(ind2)
|
||||
//
|
||||
// if ((elem1 !== null) && (elem2 !== null)) {
|
||||
// if (elem1.priority === elem2.priority) {
|
||||
// return elem1.priority
|
||||
// } else {
|
||||
// // if different priority then take the first
|
||||
// return elem1.priority
|
||||
// }
|
||||
// } else {
|
||||
// return (elem1 != null) ? elem1.priority : ((elem2 != null) ? elem2.priority : null)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
getCompleted(ind1, ind2) {
|
||||
// let elem1 = this.getelem(ind1)
|
||||
// let elem2 = this.getelem(ind2)
|
||||
//
|
||||
// if ((elem1 !== null) && (elem2 !== null)) {
|
||||
// if (elem1.completed === elem2.completed) {
|
||||
// return elem1.completed
|
||||
// } else {
|
||||
// return elem1.completed
|
||||
// }
|
||||
// } else {
|
||||
// return (elem1 != null) ? elem1.completed : ((elem2 != null) ? elem2.completed : null)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
getTitlePriority(priority) {
|
||||
let cl = ''
|
||||
|
||||
@@ -218,27 +185,6 @@ export default class Todo extends Vue {
|
||||
|
||||
await Todos.actions.swapElems(itemdragend)
|
||||
|
||||
// If the newIndex is between another priority, then change priority
|
||||
|
||||
// if (!changecompleted) {
|
||||
// // if I changed the completed, I don't have to put in other list priority
|
||||
// let newpriority = this.getPriorityToSet(indini, indfine)
|
||||
// if (newpriority != null && newpriority >= 0) {
|
||||
// myobj.modified = (myobj.priority !== newpriority) ? true : myobj.modified
|
||||
// myobj.priority = newpriority
|
||||
// console.log('NewPriority: ', newpriority)
|
||||
// }
|
||||
// }
|
||||
|
||||
// let completed = this.getCompleted(indini, indfine)
|
||||
// let changecompleted = false
|
||||
// if (completed != null) {
|
||||
// myobj.modified = (myobj.completed !== completed) ? true : myobj.modified
|
||||
// myobj.completed = completed
|
||||
// changecompleted = true
|
||||
// console.log('Newcompleted: ', completed, 'modif', myobj.modified)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
private getElementIndex(el: any) {
|
||||
@@ -250,20 +196,6 @@ export default class Todo extends Vue {
|
||||
}
|
||||
|
||||
|
||||
private getElementParentId(el: any) {
|
||||
const elem = [].slice.call(el.parentElement.children)
|
||||
console.log('elem', elem)
|
||||
const id = elem.attributes['id'].substring(3)
|
||||
return id
|
||||
}
|
||||
|
||||
private getElementId(el: any) {
|
||||
console.log(' el ', el)
|
||||
const id = el.attributes['id'].value.substring(3)
|
||||
return id
|
||||
}
|
||||
|
||||
|
||||
created() {
|
||||
const $service = this.$dragula.$service
|
||||
$service.options('first',
|
||||
@@ -288,8 +220,6 @@ export default class Todo extends Vue {
|
||||
$service.eventBus.$on('dragend', (args) => {
|
||||
|
||||
let itemdragend: IDrag = {
|
||||
// newIndex: this.getElementIndex(args.el),
|
||||
// oldIndex: this.getElementOldIndex(args.el)
|
||||
category: this.categoryAtt,
|
||||
newIndex: this.getElementIndex(args.el),
|
||||
oldIndex: this.getElementOldIndex(args.el)
|
||||
@@ -298,32 +228,29 @@ export default class Todo extends Vue {
|
||||
this.onEnd(itemdragend)
|
||||
})
|
||||
|
||||
let mythis = this
|
||||
|
||||
$service.eventBus.$on('drag', function (el, source) {
|
||||
$service.eventBus.$on('drag', (el, source) => {
|
||||
// mythis.inddragging = mythis.getElementIndex(el)
|
||||
console.log('+++ DRAG ind=', mythis.inddragging)
|
||||
mythis.scrollable = false
|
||||
console.log('+++ DRAG ind=', this.inddragging)
|
||||
this.scrollable = false
|
||||
})
|
||||
$service.eventBus.$on('drop', function (el, source) {
|
||||
$service.eventBus.$on('drop', (el, source) => {
|
||||
console.log('+++ DROP')
|
||||
mythis.scrollable = true
|
||||
this.scrollable = true
|
||||
})
|
||||
|
||||
|
||||
this.load()
|
||||
}
|
||||
|
||||
mounted() {
|
||||
mounted () {
|
||||
// console.log('*** MOUNTED ***')
|
||||
|
||||
this.categoryAtt = this.$route.params.category
|
||||
|
||||
let mythis = this
|
||||
if (window) {
|
||||
window.addEventListener('touchmove', function (e) {
|
||||
window.addEventListener('touchmove', (e) => {
|
||||
// console.log('touchmove')
|
||||
if (!mythis.scrollable) {
|
||||
if (!this.scrollable) {
|
||||
e.preventDefault()
|
||||
}
|
||||
}, { passive: false })
|
||||
@@ -367,7 +294,7 @@ export default class Todo extends Vue {
|
||||
}, 60000)
|
||||
}
|
||||
|
||||
beforedestroy() {
|
||||
beforeDestroy() {
|
||||
clearInterval(this.polling)
|
||||
}
|
||||
|
||||
@@ -431,10 +358,6 @@ export default class Todo extends Vue {
|
||||
this.todotop = ''
|
||||
else
|
||||
this.todobottom = ''
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -508,18 +431,17 @@ export default class Todo extends Vue {
|
||||
getArrTodos() {
|
||||
|
||||
let mystr = ''
|
||||
let mythis = this
|
||||
|
||||
mythis.tmpstrTodos = ''
|
||||
this.tmpstrTodos = ''
|
||||
return globalroutines(null, 'readall', 'todos', null)
|
||||
.then(function (alldata) {
|
||||
.then((alldata) => {
|
||||
const myrecs = [...alldata]
|
||||
|
||||
myrecs.forEach(rec => {
|
||||
mystr = mystr + rec.descr + rec.completed + '] ['
|
||||
})
|
||||
|
||||
mythis.tmpstrTodos = 'TODOS: ' + mystr
|
||||
this.tmpstrTodos = 'TODOS: ' + mystr
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user