3

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, { });
}
Meer
  • 2,765
  • 2
  • 19
  • 28
K.Oleksiak
  • 325
  • 1
  • 2
  • 15

2 Answers2

0

I have solved multiple image upload issue manually.

please find attached image.min.js and replace it with floara editor image.min.js.

it's work fine for me. And let me know if you have any issue so ill update it base on your requirement. Please change image.min.txt to image.min.js.

image.min.txt

Thanks.
Sanjay Parmar

0

For resolve this problem I have created the plugin for Froala Editor - Images Multi Upload.

The plugin uses options from image.js plugin and allows to send many images to the server.

Enjoy!