From 850069decb0865456c7ae51b0fbd6af0934dd872 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 27 Oct 2020 22:41:51 +0100 Subject: [PATCH] Ensure that image is cropped when aspectRatio is set --- formwidgets/responsiveimage/assets/src/popup.mixin.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/formwidgets/responsiveimage/assets/src/popup.mixin.js b/formwidgets/responsiveimage/assets/src/popup.mixin.js index c30cb0d..4470f49 100644 --- a/formwidgets/responsiveimage/assets/src/popup.mixin.js +++ b/formwidgets/responsiveimage/assets/src/popup.mixin.js @@ -52,6 +52,12 @@ export default { $.oc.flashMsg({ text: 'Bitte einen Titel angeben.', class: 'error' }); return; } + + if (_cls.aspectRatio && !_cls.popup.values.crop) { + $.oc.flashMsg({ text: 'Bitte das Bild beschneiden', class: 'error' }); + return; + } + $popup.modal('hide'); resolve(_cls.popup.values);