better working changing slides and serviceItems
This commit is contained in:
parent
e30ee1a53e
commit
1ed76ff3e3
3 changed files with 23 additions and 62 deletions
|
@ -286,25 +286,10 @@ FocusScope {
|
|||
const nextSlideIdx = currentSlide + 1;
|
||||
if (nextSlideIdx > totalSlides || nextSlideIdx < 0)
|
||||
return;
|
||||
const nextItem = SlideModel.getItem(nextSlideIdx);
|
||||
console.log("currentServiceItem " + currentServiceItem);
|
||||
console.log("currentSlide " + currentSlide);
|
||||
console.log("nextSlideIdx " + nextSlideIdx);
|
||||
console.log(nextItem.index);
|
||||
SlideObject.changeSlide(nextItem);
|
||||
currentSlide = nextSlideIdx;
|
||||
currentServiceItem = nextItem.serviceItemId;
|
||||
changeServiceItem(currentServiceItem);
|
||||
/* const change = SlideObject.next(nextItem); */
|
||||
/* console.log(change); */
|
||||
/* if (currentServiceItem === totalServiceItems - 1 & change) */
|
||||
/* return; */
|
||||
/* if (change) { */
|
||||
/* SlideObject.changeSlide(nextItem); */
|
||||
/* currentServiceItem++; */
|
||||
/* changeServiceItem(currentServiceItem); */
|
||||
/* leftDock.changeItem(); */
|
||||
/* } */
|
||||
changeSlide(nextSlideIdx);
|
||||
}
|
||||
|
||||
function nextSlide() {
|
||||
|
@ -317,26 +302,10 @@ FocusScope {
|
|||
const prevSlideIdx = currentSlide - 1;
|
||||
if (prevSlideIdx > totalSlides || prevSlideIdx < 0)
|
||||
return;
|
||||
const prevItem = SlideModel.getItem(prevSlideIdx);
|
||||
console.log("currentServiceItem " + currentServiceItem);
|
||||
console.log("currentSlide " + currentSlide);
|
||||
console.log("prevSlideIdx " + prevSlideIdx);
|
||||
console.log(prevItem.index);
|
||||
SlideObject.changeSlide(prevItem);
|
||||
currentSlide = prevSlideIdx;
|
||||
currentServiceItem = prevItem.serviceItemId;
|
||||
changeServiceItem(currentServiceItem);
|
||||
/* const change = SlideObject.previous(prevItem); */
|
||||
/* console.log(change); */
|
||||
/* if (currentServiceItem === 0 & change) { */
|
||||
/* return; */
|
||||
/* }; */
|
||||
/* if (change) { */
|
||||
/* SlideObject.changeSlide(prevItem); */
|
||||
/* currentServiceItem--; */
|
||||
/* changeServiceItem(currentServiceItem); */
|
||||
/* leftDock.changeItem(); */
|
||||
/* } */
|
||||
changeSlide(prevSlideIdx);
|
||||
}
|
||||
|
||||
function previousSlide() {
|
||||
|
@ -344,19 +313,6 @@ FocusScope {
|
|||
console.log(slideItem);
|
||||
}
|
||||
|
||||
function changeSlide() {
|
||||
if (itemType === "song") {
|
||||
SlideObject.setText(root.text[textIndex]);
|
||||
console.log(root.text[textIndex]);
|
||||
textIndex++;
|
||||
} else if (itemType === "video") {
|
||||
clearText();
|
||||
}
|
||||
else if (itemType === "image") {
|
||||
clearText();
|
||||
}
|
||||
}
|
||||
|
||||
function clearText() {
|
||||
SlideObject.setText("");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue