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

BUG: State changes are keeping the medium toolbars on page #24

Closed
sergiofilhowz opened this issue Nov 21, 2014 · 4 comments
Closed

BUG: State changes are keeping the medium toolbars on page #24

sergiofilhowz opened this issue Nov 21, 2014 · 4 comments

Comments

@sergiofilhowz
Copy link

State changes are keeping the toolbars on page, this is causing to the bottom of the page being active, but empty.

[GIF] Bug below

bug

@sergiofilhowz sergiofilhowz changed the title State changes are keeping the medium toolbars on page BUG: State changes are keeping the medium toolbars on page Nov 21, 2014
@sergiofilhowz
Copy link
Author

Fixed using this:

iElement.on('remove', function () {
    ctrl.editor.deactivate();
});

But there's some memory leak on overriding MediumEditors without deactivating existing ones.

@rkoberg
Copy link

rkoberg commented Dec 18, 2014

me too... But the above didn't work for me. In the run of my main module I put:

    $rootScope.$on('$routeChangeStart', function(event, next){
      var mediumToolbar = angular.element('.medium-editor-toolbar');
      if (mediumToolbar.length) {
        mediumToolbar.remove();
      }
...

@diefans
Copy link

diefans commented Dec 19, 2014

I fixed it by deactivating the editor on scope destroy

scope.$on('$destroy', function() {
    ctrl.editor.deactivate();
});

@rkoberg
Copy link

rkoberg commented Dec 19, 2014

diefans fix works best. This should get into the code base.

There is still an issue, though. On submit, the toolbar remains active for me. Apparently the button click or tab+enter is not enough to trigger the toolbar removal.

Is there any way to get the medium editor from the angular element object to allow deactivate from outside code?

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

3 participants