【发布时间】:2019-04-02 10:55:31
【问题描述】:
我正在使用 Froala 编辑器,但在尝试插入多个图像时偶然发现了一个问题。问题是只有第一个图像被插入而不是其余的。我在网上搜索了答案,但找不到任何答案。是否可以一次插入多个图像?
这是我的代码:
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, { });
}
【问题讨论】:
标签: javascript angularjs froala