AI OnAI Off
Seems like wrapping the code in setTimeout makes the content change happen, this but it feels a bit hackish and it would problably not work every time due to timing issues... and I don't get why it works when it's wrapped in a setTimout?
_imageSelected: function () {
setTimeout(lang.hitch(this, function() {
var codeMirror = this.editor.codemirror,
output = '';
codeMirror.replaceSelection(output);
var value = this.editor.value();
this._set("value", value);
this.onChange(value);
}), 500);
},
Hi.
I'm working on image support within a markdown editor based on SimpleMDE. The editor works great but I can't figure out how I should inform Episerver about change after the editor has selected an image in a content selector dialog.
If I just append an image-markdown-tag without going through the content selector dialog Episerver picks up the change, an tells the editor that there are changes to be published.
Note that the _imageSelected-function is called directly within the _openImageSelector-function (The code is simplified to point out the issue):
But if I hook up the _imageSelected-function to the "execute"-event of the dialog, Episerver doesn't pick up the change:
Clearly I'm missing something?
Thanks,
Anton