Browse Source

The default value of `completely` should be `true`.

NaotoshiFujita 3 years ago
parent
commit
ff0073ef84

+ 1 - 1
dist/js/splide.cjs.js

@@ -2349,7 +2349,7 @@ const _Splide = class {
     this.emit(EVENT_REFRESH);
     this.emit(EVENT_REFRESH);
     return this;
     return this;
   }
   }
-  destroy(completely) {
+  destroy(completely = true) {
     const { event, state } = this;
     const { event, state } = this;
     if (state.is(CREATED)) {
     if (state.is(CREATED)) {
       event.on(EVENT_READY, this.destroy.bind(this, completely), this);
       event.on(EVENT_READY, this.destroy.bind(this, completely), this);

+ 1 - 1
dist/js/splide.esm.js

@@ -2345,7 +2345,7 @@ const _Splide = class {
     this.emit(EVENT_REFRESH);
     this.emit(EVENT_REFRESH);
     return this;
     return this;
   }
   }
-  destroy(completely) {
+  destroy(completely = true) {
     const { event, state } = this;
     const { event, state } = this;
     if (state.is(CREATED)) {
     if (state.is(CREATED)) {
       event.on(EVENT_READY, this.destroy.bind(this, completely), this);
       event.on(EVENT_READY, this.destroy.bind(this, completely), this);

+ 4 - 0
dist/js/splide.js

@@ -2881,6 +2881,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     };
     };
 
 
     _proto.destroy = function destroy(completely) {
     _proto.destroy = function destroy(completely) {
+      if (completely === void 0) {
+        completely = true;
+      }
+
       var event = this.event,
       var event = this.event,
           state = this.state;
           state = this.state;
 
 

File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.min.js


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


File diff suppressed because it is too large
+ 0 - 0
dist/types/core/Splide/Splide.d.ts.map


+ 1 - 1
src/js/core/Splide/Splide.ts

@@ -327,7 +327,7 @@ export class Splide {
    *
    *
    * @return `this`
    * @return `this`
    */
    */
-  destroy( completely?: boolean ): this {
+  destroy( completely = true ): this {
     const { event, state } = this;
     const { event, state } = this;
 
 
     if ( state.is( CREATED ) ) {
     if ( state.is( CREATED ) ) {

+ 5 - 1
src/js/test/php/examples/default.php

@@ -19,7 +19,7 @@ $settings = get_settings();
   <script>
   <script>
     document.addEventListener( 'DOMContentLoaded', function () {
     document.addEventListener( 'DOMContentLoaded', function () {
       var splide = new Splide( '#splide01', {
       var splide = new Splide( '#splide01', {
-        type   : 'loop',
+        // type   : 'loop',
         perPage: 1,
         perPage: 1,
         gap    : '1.5rem',
         gap    : '1.5rem',
         height : 400,
         height : 400,
@@ -38,6 +38,10 @@ $settings = get_settings();
         console.log( 'moved' );
         console.log( 'moved' );
       } );
       } );
 
 
+      splide.on( 'resized', () => {
+        console.log( 'resized' );
+      } );
+
       splide.on( 'click', () => {
       splide.on( 'click', () => {
         console.log( 'click' );
         console.log( 'click' );
       } );
       } );

Some files were not shown because too many files changed in this diff