Skip to content
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

Appended elements not removed from the DOM when changing application states #61

Open
ElliottRoche opened this issue Feb 3, 2016 · 2 comments

Comments

@ElliottRoche
Copy link

I'm unsure where/why this error is happening and it may be unrelated to angular-redactor but I'm not sure where else to start.

When I'm in an application state that has redactor in the view and I navigate away from that state to a different part of the app, the redactor-toolbar-tooltip remains in the DOM. It's got a style attribute of 'display: none;' so it doesn't actually remain visible, but it persists nonetheless.

If I go back to that state with redactor in the view (or to any state with redactor for that matter) it sticks another set of redactor-toolbar-tooltips into the DOM.

So if the app isn't refreshed for sometime, there could a huge number of these tooltips still stuck in the DOM.

Here's an example:

2016-02-03 at 10 54 am

Any idea why this might be happening?

@willkramer
Copy link

Are you destroying redactor on view change? This should cleanup the DOM.

https://imperavi.com/redactor/docs/api/core/#api-destroy

@ElliottRoche
Copy link
Author

Not manually no.

I was under the impression that this part of angular-redactor.js would destroy it if it was loaded again.

                    $timeout(function() {
                        editor = element.redactor(options);
                        ngModel.$render();
                        element.on('remove',function(){
                            element.off('remove');
                            element.redactor('core.destroy');
                        });
                    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants