Skip to content
Code-Schnipsel Gruppen Projekte
Commit cf4d1cde erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: mobild and desktop detection -> server side

Übergeordneter bafbee63
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
<div class="quiqqer-bricks-promoslider-wallpaper-container"> <div class="quiqqer-bricks-promoslider-wallpaper-container">
{if $isDesktop}
{strip} {strip}
<ul class="hide-on-mobile"> <ul class="hide-on-mobile">
{foreach $desktopSlides as $key => $slide} {foreach $desktopSlides as $key => $slide}
...@@ -39,7 +40,9 @@ ...@@ -39,7 +40,9 @@
{/foreach} {/foreach}
</ul> </ul>
{/strip} {/strip}
{/if}
{if $isMobile}
{strip} {strip}
<ul class="hide-on-desktop"> <ul class="hide-on-desktop">
{foreach $mobileSlides as $key => $slide} {foreach $mobileSlides as $key => $slide}
...@@ -79,6 +82,7 @@ ...@@ -79,6 +82,7 @@
{/foreach} {/foreach}
</ul> </ul>
{/strip} {/strip}
{/if}
</div> </div>
<div class="quiqqer-bricks-promoslider-wallpaper-dots"></div> <div class="quiqqer-bricks-promoslider-wallpaper-dots"></div>
...@@ -91,4 +95,4 @@ ...@@ -91,4 +95,4 @@
{$this->getAttribute('showarrows')}"> {$this->getAttribute('showarrows')}">
<span class="fa fa-chevron-right"></span> <span class="fa fa-chevron-right"></span>
</div> </div>
{/if} {/if}
\ No newline at end of file
...@@ -239,6 +239,11 @@ public function getBody() ...@@ -239,6 +239,11 @@ public function getBody()
$Engine->assign($options); $Engine->assign($options);
$Engine->assign([
'isMobile' => QUI\MobileDetection::isMobile(),
'isDesktop' => QUI\MobileDetection::isDesktop()
]);
return $Engine->fetch($this->getAttribute('template')); return $Engine->fetch($this->getAttribute('template'));
} }
} }
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
{if $key === 0} {if $key === 0}
<noscript> <noscript>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab}target="_blank"{/if}>{/if} {if $slide.url}<a href="{$slide.url}" {if $slide.newTab}target="_blank" {/if}>{/if}
{image image=$slide.image class="quiqqer-bricks-promoslider-wallpaper2Content-noScriptImage"} {image image=$slide.image class="quiqqer-bricks-promoslider-wallpaper2Content-noScriptImage"}
{if $slide.url}</a>{/if} {if $slide.url}</a>{/if}
</noscript> </noscript>
{/if} {/if}
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</ul> </ul>
{/strip} {/strip}
{if $isMobile}
{strip} {strip}
<ul class="hide-on-desktop"> <ul class="hide-on-desktop">
{foreach $mobileSlides as $key => $slide} {foreach $mobileSlides as $key => $slide}
...@@ -54,8 +55,8 @@ ...@@ -54,8 +55,8 @@
{if $key === 0} {if $key === 0}
<noscript> <noscript>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab}target="_blank"{/if}>{/if} {if $slide.url}<a href="{$slide.url}" {if $slide.newTab}target="_blank" {/if}>{/if}
{image image=$slide.image class="quiqqer-bricks-promoslider-wallpaper2Content-noScriptImage"} {image image=$slide.image class="quiqqer-bricks-promoslider-wallpaper2Content-noScriptImage"}
{if $slide.url}</a>{/if} {if $slide.url}</a>{/if}
</noscript> </noscript>
{/if} {/if}
...@@ -64,16 +65,15 @@ ...@@ -64,16 +65,15 @@
{/foreach} {/foreach}
</ul> </ul>
{/strip} {/strip}
{/if}
</div> </div>
<div class="quiqqer-bricks-promoslider-wallpaper-dots"></div> <div class="quiqqer-bricks-promoslider-wallpaper-dots"></div>
{if count($desktopSlides) > 1 && $this->getAttribute('showarrows') != 'hide'} {if count($desktopSlides) > 1 && $this->getAttribute('showarrows') != 'hide'}
<div class="quiqqer-bricks-promoslider-wallpaper-prev hide-on-mobile <div class="quiqqer-bricks-promoslider-wallpaper-prev hide-on-mobile {$this->getAttribute('showarrows')}">
{$this->getAttribute('showarrows')}">
<span class="fa fa-chevron-left"></span> <span class="fa fa-chevron-left"></span>
</div> </div>
<div class="quiqqer-bricks-promoslider-wallpaper-next hide-on-mobile <div class="quiqqer-bricks-promoslider-wallpaper-next hide-on-mobile {$this->getAttribute('showarrows')}">
{$this->getAttribute('showarrows')}">
<span class="fa fa-chevron-right"></span> <span class="fa fa-chevron-right"></span>
</div> </div>
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren