Skip to content

Commit

Permalink
Only generate dialog markup if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Mardl committed Apr 29, 2019
1 parent d151ed2 commit b23dddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion view/frontend/templates/modal_container.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
?>

<?php if ($this->showModal()): ?>
<div data-mage-init='{"countryModal":{"contentPath": "<?php echo $this->getModalContentUrl('popup/Popup/Index'); ?>"}}' id="language-modal" style="display:none;">
<div data-mage-init='{"countryModal":{"contentPath": "<?php echo $this->getModalContentUrl('popup/Popup/Index'); ?>"}}' id="language-modal" class="hide-country-popup" style="display:none;">
<div class="img-wrapper">
<img class="modal-image" />
</div>
Expand Down
7 changes: 4 additions & 3 deletions view/frontend/web/js/country_modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ define([
responsive: this.options.modal_responsive,
innerScroll: true,
wrapperClass: 'hint-country-modal'
},
popup = modal(options, this.element);
};

if (!this.options.show_modal && !this.options.default_store) {
setTimeout(function () {
// only init modal dialog if necessary
modal(options, this.element);
this.element.removeClass('hide-country-popup');
that.element.modal('openModal', true);
if (!that.options.show_modal_overlay) {
$('.hint-country-modal').addClass('no-overlay');
Expand Down

0 comments on commit b23dddf

Please sign in to comment.