Skip to content

Commit

Permalink
Search Adobe Stock button is not active on Edit Product Page in Admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazar65 committed Nov 21, 2019
1 parent d69521f commit 610eed6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 0 additions & 1 deletion AdobeStockImageAdminUi/Plugin/AddSearchButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function beforeSetLayout(Container $subject, LayoutInterface $layout): vo
'class' => 'action-secondary',
'label' => __('Search Adobe Stock'),
'type' => 'button',
'onclick' => 'jQuery("#adobe-stock-images-search-modal").trigger("openModal");'
],
0,
0,
Expand Down
20 changes: 19 additions & 1 deletion AdobeStockImageAdminUi/view/adminhtml/templates/panel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
?>

<div id="adobe-stock-images-search-modal" style="display: none;">
<div id="adobe-stock-images-search-modal" class="adobe-search-images-modal" style="display: none;">
<div class="adobe-stock-images-search-modal-content">
<?= $block->getChildHtml(); ?>
</div>
Expand All @@ -30,3 +30,21 @@
}
}
</script>
<script>
require([
'jquery',
], function ($) {
$(function () {
var searchButton = "#search_adobe_stock",
adobeStockModal = ".adobe-search-images-modal";

$(searchButton).click(function() {
if ($(adobeStockModal).length > 1) {
$(adobeStockModal)[0].remove();
}
$(adobeStockModal).trigger("openModal");
});
});
});
</script>

0 comments on commit 610eed6

Please sign in to comment.