Skip to content

Commit

Permalink
Fix issue where media finder attachment config modal not opening (#1010)
Browse files Browse the repository at this point in the history
* fix what seem like typos

* refactor

Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>

Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
Co-authored-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
  • Loading branch information
CupNoodles and sampoyigi authored Sep 2, 2022
1 parent 6486a89 commit 2c1f30d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/admin/formwidgets/mediafinder/assets/js/mediafinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

MediaFinder.prototype.onClickConfigButton = function (event) {
var self = this,
var self = this, modal,
$container = $(event.target).closest('.media-finder'),
$mediaIdentifier = $('[data-find-identifier]', $container).val(),
$modalElement = $('<div/>', {
Expand All @@ -66,10 +66,11 @@
})

$modalElement.html(this.$configTemplate.innerHTML)
$modalElement.modal({backdrop: 'static', keyboard: false})
modal = new bootstrap.Modal($modalElement, {backdrop: 'static', keyboard: false})
modal.show()

$modalElement.one('shown.bs.modal', function (event) {
$.request(self.options.alias + '::onLoadAttachmentConfig', {
$.request(self.options.alias+'::onLoadAttachmentConfig', {
data: {media_id: $mediaIdentifier}
}).done(function () {
$modalElement.find('form').on('ajaxDone', function () {
Expand Down

0 comments on commit 2c1f30d

Please sign in to comment.