mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
ENH: model info display UI
Change-Id: I066c0e7f8ce87ec00b1141a1b44430444a819b42 (cherry picked from commit 05907a1a42da82737090d55046974d401f8af057)
This commit is contained in:
parent
0cc953ad41
commit
b4ffa91cb4
343 changed files with 54828 additions and 2 deletions
|
@ -0,0 +1,47 @@
|
|||
export default function removeSlide(slidesIndexes) {
|
||||
const swiper = this;
|
||||
const {
|
||||
params,
|
||||
$wrapperEl,
|
||||
activeIndex
|
||||
} = swiper;
|
||||
let activeIndexBuffer = activeIndex;
|
||||
|
||||
if (params.loop) {
|
||||
activeIndexBuffer -= swiper.loopedSlides;
|
||||
swiper.loopDestroy();
|
||||
swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
|
||||
}
|
||||
|
||||
let newActiveIndex = activeIndexBuffer;
|
||||
let indexToRemove;
|
||||
|
||||
if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
|
||||
for (let i = 0; i < slidesIndexes.length; i += 1) {
|
||||
indexToRemove = slidesIndexes[i];
|
||||
if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();
|
||||
if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
|
||||
}
|
||||
|
||||
newActiveIndex = Math.max(newActiveIndex, 0);
|
||||
} else {
|
||||
indexToRemove = slidesIndexes;
|
||||
if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();
|
||||
if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
|
||||
newActiveIndex = Math.max(newActiveIndex, 0);
|
||||
}
|
||||
|
||||
if (params.loop) {
|
||||
swiper.loopCreate();
|
||||
}
|
||||
|
||||
if (!params.observer) {
|
||||
swiper.update();
|
||||
}
|
||||
|
||||
if (params.loop) {
|
||||
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
||||
} else {
|
||||
swiper.slideTo(newActiveIndex, 0, false);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue