@egjs/flicking
Advanced tools
Comparing version 4.4.1 to 4.4.2
{ | ||
"name": "@egjs/flicking", | ||
"version": "4.4.1", | ||
"version": "4.4.2", | ||
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.", | ||
@@ -5,0 +5,0 @@ "main": "dist/flicking.js", |
@@ -9,3 +9,2 @@ <h1 align="center" style="max-width: 100%;"> | ||
<a href="https://www.npmjs.com/package/@egjs/flicking" target="_blank"><img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@egjs/flicking.svg?style=flat-square&label=%F0%9F%92%BE%20gzipped&color=007acc" /></a> | ||
<a href="https://travis-ci.org/naver/egjs-flicking" target="_blank"><img alt="Travis (.org)" src="https://img.shields.io/travis/naver/egjs-flicking.svg?style=flat-square&label=build&logo=travis%20ci" /></a> | ||
<a href="https://coveralls.io/github/naver/egjs-flicking?branch=master&style=flat-square" target="_blank"><img alt="Coveralls github" src="https://img.shields.io/coveralls/github/naver/egjs-flicking.svg?style=flat-square&label=%E2%9C%85%20coverage" /></a> | ||
@@ -12,0 +11,0 @@ <a href="https://deepscan.io/dashboard#view=project&tid=3998&pid=5802&bid=46086"><img src="https://deepscan.io/api/teams/3998/projects/5802/branches/46086/badge/grade.svg" alt="DeepScan grade" /></a> |
@@ -81,3 +81,3 @@ /* | ||
* @property {number} min A minimum position<ko>최소 위치</ko> | ||
* @property {number} min A maximum position<ko>최대 위치</ko> | ||
* @property {number} max A maximum position<ko>최대 위치</ko> | ||
* @readonly | ||
@@ -84,0 +84,0 @@ */ |
@@ -9,2 +9,3 @@ import { DiffResult } from "@egjs/list-differ"; | ||
const panels = renderer.panels; | ||
const prevList = [...diffResult.prevList]; | ||
@@ -28,2 +29,4 @@ if (diffResult.removed.length > 0) { | ||
} | ||
prevList.splice(removedIdx, 1); | ||
}); | ||
@@ -61,2 +64,4 @@ | ||
const addedElements = rendered.slice(prevList.length); | ||
diffResult.added.forEach((addedIdx, idx) => { | ||
@@ -68,3 +73,3 @@ if (startIdx < 0) { | ||
if (prevIdx >= 0 && addedIdx !== prevIdx + 1) { | ||
batchInsert(renderer, diffResult, rendered, startIdx, idx + 1); | ||
batchInsert(renderer, diffResult, addedElements, startIdx, idx + 1); | ||
@@ -79,3 +84,3 @@ startIdx = -1; | ||
if (startIdx >= 0) { | ||
batchInsert(renderer, diffResult, rendered, startIdx); | ||
batchInsert(renderer, diffResult, addedElements, startIdx); | ||
} | ||
@@ -85,5 +90,5 @@ } | ||
const batchInsert = (renderer: Renderer, diffResult: DiffResult<any>, rendered: any[], startIdx: number, endIdx?: number) => { | ||
const batchInsert = (renderer: Renderer, diffResult: DiffResult<any>, addedElements: any[], startIdx: number, endIdx?: number) => { | ||
renderer.batchInsert( | ||
...diffResult.added.slice(startIdx, endIdx).map((index, elIdx) => ({ index, elements: [rendered[elIdx + diffResult.prevList.length]], hasDOMInElements: false })) | ||
...diffResult.added.slice(startIdx, endIdx).map((index, elIdx) => ({ index, elements: [addedElements[elIdx]], hasDOMInElements: false })) | ||
); | ||
@@ -90,0 +95,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3711305
37928
180