Skip to content

Commit bb26b84

Browse files
authored
Merge pull request #357 from magento/magento-mpi-MC-29529
[Support] MC-29529: Slider upload from gallery is not possible
2 parents 8a91d02 + c6459e8 commit bb26b84

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/image-uploader.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,19 @@ define([
235235
hasData: function () {
236236
// Some of the components automatically add an empty object if the value is unset.
237237
return this._super() && !$.isEmptyObject(this.value()[0]);
238+
},
239+
240+
/**
241+
* Stop event to prevent it from reaching any objects other than the current object.
242+
*
243+
* @param {Object} uploader
244+
* @param {Event} event
245+
* @returns {Boolean}
246+
*/
247+
stopEvent: function (uploader, event) {
248+
event.stopPropagation();
249+
250+
return true;
238251
}
239252
});
240253
});

app/code/Magento/PageBuilder/view/adminhtml/web/template/form/element/uploader/preview/image.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
<div class="pagebuilder-options-wrapper">
1111
<ul class="pagebuilder-options-links">
1212
<li class="pagebuilder-options-link">
13-
<label class="file-uploader-button action-default" attr="for: uid" disable="disabled" translate="translations.uploadNewImage" />
13+
<label
14+
data-bind="event: {mousedown: stopEvent}"
15+
class="file-uploader-button action-default"
16+
attr="for: uid"
17+
disable="disabled"
18+
translate="translations.uploadNewImage" />
1419
</li>
1520
<li class="pagebuilder-options-link">
1621
<label
17-
data-bind="event: {change: addFileFromMediaGallery, click: openMediaBrowserDialog}"
22+
data-bind="event: {change: addFileFromMediaGallery, click: openMediaBrowserDialog, mousedown: stopEvent}"
1823
class="file-uploader-button action-default"
1924
attr="id: mediaGalleryUid, 'data-id': getFileId()"
2025
disable="disabled"

0 commit comments

Comments
 (0)