I'm using Froala Editor and stumbled upon a problem while trying to insert multiple images. The problem is that only the first image gets inserted and not the rest. I have searched the web for answers but can't find any. Is it possible to insert more then one images at a time?
Here is my code:
function show() {
$current_image = editor.image.get();
var image = {
id: 0
}
angular
.element($('html'))
.scope()
.showImageManager(image)
.then(function (imageList) {
for (var i = 0; i < imageList.length; i++) {
insert(imageList[i].url);
}
});
}
function insert(url) {
if (!$current_image) {
// Make sure we have focus.
editor.events.focus(true);
editor.selection.restore();
}
else {
$current_image.trigger('click');
}
editor.undo.saveStep();
editor.image.insert(url, false, {}, $current_image, { });
}