Skip to content

Commit

Permalink
Fixed a bug where it was impossible to insert two images at once.
Browse files Browse the repository at this point in the history
Resolve #200
  • Loading branch information
andris-sevcenko committed Feb 12, 2020
1 parent eeda375 commit b59f1e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Fixed the toolbar not being sticky when in live preview. ([#157](https://github.com/craftcms/redactor/issues/157)
- Fixed the context bar positioning when clicking links or images. ([#201](https://github.com/craftcms/redactor/issues/201))
- Fixed the image resize handle positioning when clicking images with `imageResizable` enabled. ([#205](https://github.com/craftcms/redactor/issues/205), [#183](https://github.com/craftcms/redactor/issues/183))
- Fixed a bug where it was impossible to insert two images at once. ([#200](https://github.com/craftcms/redactor/issues/200))

## 2.5.0 - 2020-01-17

Expand Down
8 changes: 4 additions & 4 deletions src/assets/field/dist/js/CraftAssetImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var plugin = $.extend({}, Craft.Redactor.PluginBase, {
}

this.app.selectionMarkers = false;
var data = {};

for (var i = 0; i < assets.length; i++) {
var asset = assets[i],
Expand All @@ -38,14 +39,13 @@ var plugin = $.extend({}, Craft.Redactor.PluginBase, {
url += ':transform:' + transform;
}

var data = {};
data['asset'+asset.id] = {
url: url,
id: asset.id
};

this.app.api('module.image.insert', data);
}

this.app.api('module.image.insert', data);
}
}, this),
closeOtherModals: false,
Expand All @@ -68,4 +68,4 @@ var plugin = $.extend({}, Craft.Redactor.PluginBase, {

(function($R) {
$R.add('plugin', 'craftAssetImages', plugin);
})(Redactor);
})(Redactor);
2 changes: 1 addition & 1 deletion src/assets/field/dist/js/CraftAssetImages.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/field/dist/js/CraftAssetImages.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b59f1e7

Please sign in to comment.