From 1bee98f4fc4790e3efb06dde51ec955fdeffb073 Mon Sep 17 00:00:00 2001 From: Max Franz Date: Thu, 25 Jul 2019 12:54:13 -0400 Subject: [PATCH] Revise `cy.automove('destroy')` Ref : Destroy all rules fails with exception #20 --- src/automove.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/automove.js b/src/automove.js index 22afaa68..db1723cf 100644 --- a/src/automove.js +++ b/src/automove.js @@ -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 );