- Created complete documentation in docs/ directory - Added PROJECT_OVERVIEW.md with feature highlights and getting started guide - Added ARCHITECTURE.md with system design and technical details - Added SECURITY.md with comprehensive security implementation guide - Added DEVELOPMENT.md with development workflows and best practices - Added DEPLOYMENT.md with production deployment instructions - Added API.md with complete REST API documentation - Added CONTRIBUTING.md with contribution guidelines - Added CHANGELOG.md with version history and migration notes - Reorganized all documentation files into docs/ directory for better organization - Updated README.md with proper documentation links and quick navigation - Enhanced project structure with professional documentation standards
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
export default function removeSlide(slidesIndexes) {
|
|
const swiper = this;
|
|
const {
|
|
params,
|
|
activeIndex
|
|
} = swiper;
|
|
let activeIndexBuffer = activeIndex;
|
|
if (params.loop) {
|
|
activeIndexBuffer -= swiper.loopedSlides;
|
|
swiper.loopDestroy();
|
|
}
|
|
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[indexToRemove].remove();
|
|
if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
|
|
}
|
|
newActiveIndex = Math.max(newActiveIndex, 0);
|
|
} else {
|
|
indexToRemove = slidesIndexes;
|
|
if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove();
|
|
if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
|
|
newActiveIndex = Math.max(newActiveIndex, 0);
|
|
}
|
|
swiper.recalcSlides();
|
|
if (params.loop) {
|
|
swiper.loopCreate();
|
|
}
|
|
if (!params.observer || swiper.isElement) {
|
|
swiper.update();
|
|
}
|
|
if (params.loop) {
|
|
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
|
} else {
|
|
swiper.slideTo(newActiveIndex, 0, false);
|
|
}
|
|
} |