Skip to content

Commit

Permalink
Revise cy.automove('destroy')
Browse files Browse the repository at this point in the history
Ref : Destroy all rules fails with exception #20
  • Loading branch information
maxkfranz committed Jul 25, 2019
1 parent 8cf0e24 commit 1bee98f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/automove.js
Expand Up @@ -410,7 +410,12 @@ let automove = function( options ){
}

if( options === 'destroy' ){
scratch.rules.forEach(function( r ){ r.destroy(); });
scratch.rules.forEach(function( r ){
unbindAllOnRule( r );

r.destroyed = true;
});

scratch.rules.splice( 0, scratch.rules.length );

unbindForNodeList( cy, scratch );
Expand Down

0 comments on commit 1bee98f

Please sign in to comment.