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

catch remote image callback only update the innerHTML of editor body but not angular model #17

Closed
coffee4code opened this issue Aug 17, 2016 · 0 comments

Comments

@coffee4code
Copy link

_Bug if enable catch remote image:_

When enable catch remote image by set config item

catchRemoteImageEnable = true
  1. Paste image into editor.

  2. After request of http://server.com/path/to/controller?action=catchimage... completed,

    the html, or let's say img src, in the editor body wil be updated (you can check by inspect element),

    but when you debug or submit your ng-model, the img src in the content hasn't been updated.


_An easy fix for now:_

Catch event catchremotesuccess by addListener("catchremotesuccess",...).

Code:

_self.editor.addListener("contentChange", function() {
    ctrl.$setViewValue(_self.editor.getContent());
    if (!_updateByRender) {
        if (!$S.$$phase) {
            $S.$apply();
        }
    }
    _updateByRender = false;
});

// add code here 
// catch catchremotesuccess event and react the same as event contentChange
_self.editor.addListener("catchremotesuccess", function() {
    ctrl.$setViewValue(_self.editor.getContent());
    if (!_updateByRender) {
        if (!$S.$$phase) {
            $S.$apply();
        }
    }
    _updateByRender = false;
});
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

1 participant