fixed all eslint errors and warning, compiled as PROD
This commit is contained in:
@@ -17,17 +17,17 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
// console.log('Home beforeMount');
|
||||
// console.log('Home beforeMount')
|
||||
// compile the html src (coming from parent with props or from ajax call)
|
||||
if(this.html){
|
||||
// console.log('html', this.html);
|
||||
if (this.html) {
|
||||
// console.log('html', this.html)
|
||||
this.compileTemplate()
|
||||
}
|
||||
},
|
||||
render(h) {
|
||||
if(!this.template){
|
||||
if (!this.template) {
|
||||
return h('span', 'Loading ...')
|
||||
}else{
|
||||
} else {
|
||||
return this.template.render.call(this)
|
||||
}
|
||||
},
|
||||
@@ -43,19 +43,19 @@ export default {
|
||||
setTimeout(this.initShowroomCarroussel.bind(this), 250)
|
||||
},
|
||||
initShowroomCarroussel(){
|
||||
console.log("startShowroomCarroussel");
|
||||
console.log('startShowroomCarroussel')
|
||||
this.showrooms = document.querySelectorAll('.field--name-computed-showrooms-reference > .field__item')
|
||||
console.log('showrooms', this.showrooms);
|
||||
console.log('showrooms', this.showrooms)
|
||||
|
||||
for (var i = 0; i < this.showrooms.length; i++) {
|
||||
for (let i = 0; i < this.showrooms.length; i++) {
|
||||
if (i%2 === 0) {
|
||||
this.showroomsOdd.push(this.showrooms[i])
|
||||
}else{
|
||||
} else {
|
||||
this.showroomsEven.push(this.showrooms[i])
|
||||
}
|
||||
}
|
||||
console.log('Odd', this.showroomsOdd);
|
||||
console.log('Even', this.showroomsEven);
|
||||
console.log('Odd', this.showroomsOdd)
|
||||
console.log('Even', this.showroomsEven)
|
||||
|
||||
// TODO: share media query and variables between scss and js
|
||||
let column_width= 205
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
this.checkShowroomMode(mediaQuery)
|
||||
|
||||
// this.showroomInterval = setInterval(this.switchShowroomCarroussel.bind(this), 5000);
|
||||
// console.log('this.showroomInterval', this.showroomInterval);
|
||||
// console.log('this.showroomInterval', this.showroomInterval)
|
||||
// this.switchShowroomCarroussel()
|
||||
},
|
||||
checkShowroomMode(mq){
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
if(newmode !== this.showroomMode) {
|
||||
// if new mode different from old mode
|
||||
// reset sowrooms classes
|
||||
for (var i = 0; i < this.showrooms.length; i++) {
|
||||
for (let i = 0; i < this.showrooms.length; i++) {
|
||||
this.showrooms[i].classList.remove('active')
|
||||
}
|
||||
// record new mode
|
||||
@@ -96,16 +96,16 @@ export default {
|
||||
}
|
||||
// in any case (re)launch the animation
|
||||
this.showroomInterval = setInterval(this.switchShowroomCarroussel.bind(this), 15000);
|
||||
console.log('this.showroomInterval', this.showroomInterval);
|
||||
console.log('this.showroomInterval', this.showroomInterval)
|
||||
this.switchShowroomCarroussel()
|
||||
},
|
||||
switchShowroomCarroussel(){
|
||||
// console.log('switchShowroomCarroussel i', $elmts, i);
|
||||
// console.log('switchShowroomCarroussel i', $elmts, i)
|
||||
if (this.showroomMode === 1) {
|
||||
this.showrooms[this.showroomI].classList.add('active')
|
||||
this.showrooms[this.showroomI-1 < 0 ? this.showrooms.length -1 : this.showroomI-1].classList.remove('active')
|
||||
this.showroomI = this.showroomI+1 >= this.showrooms.length ? 0 : this.showroomI+1
|
||||
}else{
|
||||
} else {
|
||||
this.showroomsOdd[this.showroomI].classList.add('active')
|
||||
this.showroomsOdd[this.showroomI-1 < 0 ? this.showroomsOdd.length -1 : this.showroomI-1].classList.remove('active')
|
||||
this.showroomI = this.showroomI+1 >= this.showroomsOdd.length ? 0 : this.showroomI+1
|
||||
@@ -117,15 +117,15 @@ export default {
|
||||
}
|
||||
},
|
||||
onClickLink(e){
|
||||
console.log("onClickLink", e, this.$router, this.$route);
|
||||
console.log("onClickLink", e, this.$router, this.$route)
|
||||
let path = null;
|
||||
// find existing router route compared with link href
|
||||
for (var i = 0; i < this.$router.options.routes.length; i++) {
|
||||
for (let i = 0; i < this.$router.options.routes.length; i++) {
|
||||
if (this.$router.options.routes[i].path == e.originalTarget.pathname) {
|
||||
if (e.originalTarget.pathname !== this.$route.path) {
|
||||
path = e.originalTarget.pathname
|
||||
}
|
||||
break;
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onClickFieldLabel(e){
|
||||
console.log("onClickFieldLabel", e, this.$router, this.$route);
|
||||
console.log("onClickFieldLabel", e, this.$router, this.$route)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
Reference in New Issue
Block a user