From 9eb187f807855ac05432b5315ba8f692842fd7be Mon Sep 17 00:00:00 2001 From: Florian Eisenmenger Date: Wed, 16 Mar 2022 10:21:04 +0100 Subject: [PATCH] fixes --- .../js/zenit-platform-atmos-set1.js | 16 ++- .../app/storefront/src/scss/base.scss | 1 + .../src/scss/layout/_search-suggest.scss | 11 ++ .../layout/header/search-suggest.html.twig | 127 +++++++++++++++++ .../js/zenit-platform-atmos-set2.js | 12 +- .../app/storefront/src/scss/base.scss | 1 + .../src/scss/layout/_search-suggest.scss | 11 ++ .../layout/header/search-suggest.html.twig | 132 ++++++++++++++++++ 8 files changed, 299 insertions(+), 12 deletions(-) create mode 100644 zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss create mode 100644 zenitPlatformAtmosSet1/src/Resources/views/storefront/layout/header/search-suggest.html.twig create mode 100644 zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss create mode 100644 zenitPlatformAtmosSet2/src/Resources/views/storefront/layout/header/search-suggest.html.twig diff --git a/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js b/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js index b6fa04a..803cf64 100644 --- a/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js +++ b/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js @@ -128,13 +128,15 @@ function setIncludedDays(delivery, fp, addDays) { } $.fn.isInViewport = function() { - var elementTop = $(this).offset().top + 50; - var elementBottom = elementTop + $(this).outerHeight(); - - var viewportTop = $(window).scrollTop(); - var viewportBottom = viewportTop + $(window).height(); - - return elementBottom > viewportTop && elementTop < viewportBottom; + if ($(this).length) { + var elementTop = $(this).offset().top + 50; + var elementBottom = elementTop + $(this).outerHeight(); + + var viewportTop = $(window).scrollTop(); + var viewportBottom = viewportTop + $(window).height(); + + return elementBottom > viewportTop && elementTop < viewportBottom; + } }; function tagBar(sticky, parentContainer, stickyTop) { diff --git a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/base.scss b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/base.scss index 4347328..c7e4294 100644 --- a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/base.scss +++ b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/base.scss @@ -1,5 +1,6 @@ @import 'layout/header'; @import 'layout/header-minimal'; +@import 'layout/search-suggest'; @import 'layout/container'; @import 'layout/footer'; @import 'component/card'; diff --git a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss new file mode 100644 index 0000000..0a8c722 --- /dev/null +++ b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss @@ -0,0 +1,11 @@ +.search-suggest-list .search-suggest-product-name { + position: relative; + padding-right: 34px; + .filterIcon { + position: absolute; + right: 8px; + top: 50%; + transform: translate(0,-50%); + width: 22px; + } +} \ No newline at end of file diff --git a/zenitPlatformAtmosSet1/src/Resources/views/storefront/layout/header/search-suggest.html.twig b/zenitPlatformAtmosSet1/src/Resources/views/storefront/layout/header/search-suggest.html.twig new file mode 100644 index 0000000..7e0bccf --- /dev/null +++ b/zenitPlatformAtmosSet1/src/Resources/views/storefront/layout/header/search-suggest.html.twig @@ -0,0 +1,127 @@ +{% sw_extends '@Storefront/storefront/layout/header/search-suggest.html.twig' %} +{% block layout_search_suggest_result_name %} +
+ {{ product.translated.name }} + {% if product.customFields.custom_productteaser_filter_icon is defined %} +
+ {% if product.customFields.custom_productteaser_filter_icon == "fisch" %} + + + + + + + + {% endif %} + {% if product.customFields.custom_productteaser_filter_icon == "gefluegel" %} + + + + + {% endif %} + {% if product.customFields.custom_productteaser_filter_icon == "ohne_schwein" %} + + + + + + {% endif %} + {% if product.customFields.custom_productteaser_filter_icon == "vegetarisch" %} + + + + + {% endif %} +
+ {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js b/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js index 6d251a7..7907302 100644 --- a/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js @@ -126,13 +126,15 @@ function setIncludedDays(delivery, fp, addDays) { } $.fn.isInViewport = function() { - var elementTop = $(this).offset().top + 50; - var elementBottom = elementTop + $(this).outerHeight(); + if ($(this).length) { + var elementTop = $(this).offset().top + 50; + var elementBottom = elementTop + $(this).outerHeight(); - var viewportTop = $(window).scrollTop(); - var viewportBottom = viewportTop + $(window).height(); + var viewportTop = $(window).scrollTop(); + var viewportBottom = viewportTop + $(window).height(); - return elementBottom > viewportTop && elementTop < viewportBottom; + return elementBottom > viewportTop && elementTop < viewportBottom; + } }; function tagBar(sticky, parentContainer, stickyTop) { diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/base.scss b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/base.scss index 4347328..c7e4294 100644 --- a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/base.scss +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/base.scss @@ -1,5 +1,6 @@ @import 'layout/header'; @import 'layout/header-minimal'; +@import 'layout/search-suggest'; @import 'layout/container'; @import 'layout/footer'; @import 'component/card'; diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss new file mode 100644 index 0000000..0a8c722 --- /dev/null +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/layout/_search-suggest.scss @@ -0,0 +1,11 @@ +.search-suggest-list .search-suggest-product-name { + position: relative; + padding-right: 34px; + .filterIcon { + position: absolute; + right: 8px; + top: 50%; + transform: translate(0,-50%); + width: 22px; + } +} \ No newline at end of file diff --git a/zenitPlatformAtmosSet2/src/Resources/views/storefront/layout/header/search-suggest.html.twig b/zenitPlatformAtmosSet2/src/Resources/views/storefront/layout/header/search-suggest.html.twig new file mode 100644 index 0000000..957ddf5 --- /dev/null +++ b/zenitPlatformAtmosSet2/src/Resources/views/storefront/layout/header/search-suggest.html.twig @@ -0,0 +1,132 @@ +{% sw_extends '@Storefront/storefront/layout/header/search-suggest.html.twig' %} +{% block layout_search_suggest_result_name %} +
+ {{ product.translated.name }} + {% if product.customFields.custom_productteaser_filter_icon is defined %} +
+ {% if product.customFields.custom_productteaser_filter_icon is defined %} +
+ {% if product.customFields.custom_productteaser_filter_icon == "fisch" %} + + + + + + + + {% endif %} + {% if product.customFields.custom_productteaser_filter_icon == "gefluegel" %} + + + + + {% endif %} + {% if product.customFields.custom_productteaser_filter_icon == "ohne_schwein" %} + + + + + + {% endif %} + {% if product.customFields.custom_productteaser_filter_icon == "vegetarisch" %} + + + + + {% endif %} +
+ {% endif %} +
+ {% endif %} +
+{% endblock %} \ No newline at end of file