فهرست منبع

Bug Fix: add() and remove() didn't work correctly in loop mode(#145).

NaotoshiFujita 4 سال پیش
والد
کامیت
55782b60b2
8فایلهای تغییر یافته به همراه15 افزوده شده و 10 حذف شده
  1. 5 3
      dist/js/splide.esm.js
  2. 5 3
      dist/js/splide.js
  3. 1 1
      dist/js/splide.min.js
  4. BIN
      dist/js/splide.min.js.gz
  5. 1 1
      package-lock.json
  6. 1 1
      package.json
  7. 1 0
      src/js/components/clones/index.js
  8. 1 1
      src/js/splide.js

+ 5 - 3
dist/js/splide.esm.js

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 2.4.17
+ * Version  : 2.4.18
  * License  : MIT
  * Copyright: 2020 Naotoshi Fujita
  */
@@ -1684,7 +1684,7 @@ var Splide = /*#__PURE__*/function () {
   ;
 
   _proto.refresh = function refresh() {
-    this.emit('refresh').emit('resize');
+    this.emit('refresh:before').emit('refresh').emit('resize');
     return this;
   }
   /**
@@ -3097,7 +3097,9 @@ var abs = Math.abs;
 
       if (Splide.is(LOOP)) {
         init();
-        Splide.on('refresh', init).on('resize', function () {
+        Splide.on('refresh:before', function () {
+          _this.destroy();
+        }).on('refresh', init).on('resize', function () {
           if (cloneCount !== getCloneCount()) {
             // Destroy before refresh not to collect clones by the Elements component.
             _this.destroy();

+ 5 - 3
dist/js/splide.js

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 2.4.17
+ * Version  : 2.4.18
  * License  : MIT
  * Copyright: 2020 Naotoshi Fujita
  */
@@ -1697,7 +1697,7 @@ var Splide = /*#__PURE__*/function () {
   ;
 
   _proto.refresh = function refresh() {
-    this.emit('refresh').emit('resize');
+    this.emit('refresh:before').emit('refresh').emit('resize');
     return this;
   }
   /**
@@ -3110,7 +3110,9 @@ var abs = Math.abs;
 
       if (Splide.is(LOOP)) {
         init();
-        Splide.on('refresh', init).on('resize', function () {
+        Splide.on('refresh:before', function () {
+          _this.destroy();
+        }).on('refresh', init).on('resize', function () {
           if (cloneCount !== getCloneCount()) {
             // Destroy before refresh not to collect clones by the Elements component.
             _this.destroy();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/js/splide.min.js


BIN
dist/js/splide.min.js.gz


+ 1 - 1
package-lock.json

@@ -1,6 +1,6 @@
 {
   "name": "@splidejs/splide",
-  "version": "2.4.17",
+  "version": "2.4.18",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@splidejs/splide",
-  "version": "2.4.17",
+  "version": "2.4.18",
   "description": "Splide is a lightweight and powerful slider/carousel without any dependencies.",
   "author": "Naotoshi Fujita",
   "license": "MIT",

+ 1 - 0
src/js/components/clones/index.js

@@ -55,6 +55,7 @@ export default ( Splide, Components ) => {
 				init();
 
 				Splide
+					.on( 'refresh:before', () => { this.destroy() } )
 					.on( 'refresh', init )
 					.on( 'resize', () => {
 						if ( cloneCount !== getCloneCount() ) {

+ 1 - 1
src/js/splide.js

@@ -200,7 +200,7 @@ export default class Splide {
 	 * Destroy all Slide objects and clones and recreate them again.
 	 */
 	refresh() {
-		this.emit( 'refresh' ).emit( 'resize' );
+		this.emit( 'refresh:before' ).emit( 'refresh' ).emit( 'resize' );
 		return this;
 	}
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است