Ver código fonte

Bug Fix: Should not update the position if the type is 'fade'.

NaotoshiFujita 3 anos atrás
pai
commit
9b928854c5

+ 3 - 1
dist/js/splide.js

@@ -1429,7 +1429,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     var shouldSnap = true;
 
     function mount() {
-      on([EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition, DEFAULT_EVENT_PRIORITY - 1);
+      if (!Splide2.is(FADE)) {
+        on([EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition, DEFAULT_EVENT_PRIORITY - 1);
+      }
     }
 
     function reposition() {

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/js/splide.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/js/splide.min.js


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


+ 10 - 0
dist/types/utils/dom/measure/measure.d.ts

@@ -0,0 +1,10 @@
+/**
+ * Attempts to convert the provided value to pixel as the relative value to the parent element.
+ *
+ * @param parent - A parent element.
+ * @param value  - A value to convert.
+ *
+ * @return A converted value in pixel. Unhandled values will become 0.
+ */
+export declare function measure(parent: HTMLElement, value: number | string): number;
+//# sourceMappingURL=../../../../../src/js/utils/dom/measure/measure.d.ts.map

+ 1 - 0
dist/types/utils/dom/measure/measure.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["measure.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAI,MAAM,CAQ7E"}

+ 4 - 2
src/js/components/Move/Move.ts

@@ -1,7 +1,7 @@
 import { EVENT_MOVE, EVENT_MOVED, EVENT_REFRESH, EVENT_RESIZED, EVENT_UPDATED } from '../../constants/events';
 import { DEFAULT_EVENT_PRIORITY } from '../../constants/priority';
 import { IDLE, MOVING } from '../../constants/states';
-import { LOOP, SLIDE } from '../../constants/types';
+import { FADE, LOOP, SLIDE } from '../../constants/types';
 import { EventInterface } from '../../constructors';
 import { Splide } from '../../core/Splide/Splide';
 import { BaseComponent, Components, Options } from '../../types';
@@ -58,7 +58,9 @@ export function Move( Splide: Splide, Components: Components, options: Options )
    * Called when the component is mounted.
    */
   function mount(): void {
-    on( [ EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH ], reposition, DEFAULT_EVENT_PRIORITY - 1 );
+    if ( ! Splide.is( FADE ) ) {
+      on( [ EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH ], reposition, DEFAULT_EVENT_PRIORITY - 1 );
+    }
   }
 
   /**

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff