-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raptor destroy is broken #173
Comments
Can confirm. Calling it first time does something since calling it a second time gives this error:
But nothing seems to actually happen after the first call. I can still edit elements after calling it. |
Hey @Petah not sure if it was you who raised this or were just logging here on behalf of someone else but was just looking at this issue. I see there was a commit way back in 2013 (sha: d9405e4) in which the destroy() method was commented out in raptor-widget.js. It's mostly a call to destruct() which does seem to work as advertised in the raptor-editor docs, i.e..
Is $('.editable').raptor('destruct'); the functionality you were looking for @AriPaaWun ? If so maybe we should reintroduce that destroy() alias as it is a commonly used name for such things in other projects for garbage-collection-like operations. |
I would have raised it on behalf. Also I can't remember why the destroy method was removed, most likely it didn't work correctly, couldn't be re initialised after, or caused memory leaks (which would be especially bad when using Raptor in an Angular app etc). |
Yeah there's no easy way of going back after this call as it stands at the moment, be interesting to know what the original intent was. I think this should be marked closed as not a bug without any other info. |
Its a legit bug as destroy should literally remove all functionality that Raptor placed on the elements, which it currently does not. I tested the destruct function and its not quite there, it removes some functionality but still leaves some in a broken state: http://jsfiddle.net/6dvbbgcu/ |
Brilliant, thanks for the jsfiddle. |
Cannot seem to destroy an instance of Raptor after initialisation. Should be as simple as:
But it doesn't work.
The text was updated successfully, but these errors were encountered: