This commit is contained in:
ThatOneCalculator 2022-09-05 18:34:48 -07:00
parent c89d8c7ef7
commit e3e95e86fa
2 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "12.118.1-calc.2-beta.2-rc.7",
"version": "12.118.1-calc.2-beta.2-rc.8",
"codename": "aqua",
"repository": {
"type": "git",

View File

@ -114,7 +114,11 @@ const rootEl = $ref<HTMLElement>();
let queue = $ref(0);
const src = $computed({
get: () => defaultStore.reactiveState.tl.value.src,
set: (x) => saveSrc(x),
set: (x) => {
saveSrc(x);
console.log('set src', x);
syncSlide(x);
},
});
watch($$(src), () => (queue = 0));
@ -277,11 +281,11 @@ function setSwiperRef(swiper) {
}
function onSlideChange() {
if (swiperRef) {
const index = swiperRef.activeIndex;
saveSrc(timelines[swiperRef.activeIndex]);
swiperRef.slideTo(index - 1, 0);
}
saveSrc(timelines[swiperRef.activeIndex]);
}
function syncSlide(index) {
swiperRef.slideTo(index);
}
</script>