From ad7a0a20f094d5e936e4bb503946453c5c89ed18 Mon Sep 17 00:00:00 2001 From: RostislavKreisinger <58297931+RostislavKreisinger@users.noreply.github.com> Date: Tue, 21 Apr 2020 13:30:49 +0200 Subject: [PATCH] fixed not working popup window on single image (#1630) --- assets/js/frontend/components/index.js | 1 + assets/js/frontend/components/popup.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 assets/js/frontend/components/popup.js diff --git a/assets/js/frontend/components/index.js b/assets/js/frontend/components/index.js index 6577dd5489..53f5ddaf18 100644 --- a/assets/js/frontend/components/index.js +++ b/assets/js/frontend/components/index.js @@ -19,3 +19,4 @@ import './responsiveTooltip'; import './safariDetection'; import './SearchAutocomplete'; import './spinbox'; +import './popup'; diff --git a/assets/js/frontend/components/popup.js b/assets/js/frontend/components/popup.js new file mode 100644 index 0000000000..8424156198 --- /dev/null +++ b/assets/js/frontend/components/popup.js @@ -0,0 +1,13 @@ +import 'magnific-popup'; +import Register from 'framework/common/utils/Register'; + +export default class Popup { + + static init ($container) { + $container.filterAllNodes('.js-popup-image').magnificPopup({ + type: 'image' + }); + } +} + +new Register().registerCallback(Popup.init);