Skip to content
Code-Schnipsel Gruppen Projekte
Commit 5b60af43 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

fix: no js error if there is no linked page in other language.

Related: #144

Closes: #144
Übergeordneter 2e2869d1
No related branches found
No related tags found
1 Merge Request!17fix: no js error if there is no linked page in other language.
Dieser Commit ist Teil des Merge Request !17. Hier erstellte Kommentare werden im Kontext dieses Merge Request erstellt.
...@@ -35,7 +35,6 @@ public function __construct($attributes = []) ...@@ -35,7 +35,6 @@ public function __construct($attributes = [])
'dropdownText' => 'text', // false: disable text, `abbreviation`: i.e. DE, EN, `text`: i.e. German, English 'dropdownText' => 'text', // false: disable text, `abbreviation`: i.e. DE, EN, `text`: i.e. German, English
'dropdownPosition' => 'right', // 'right', 'left'. stick to right or left bottom control corner 'dropdownPosition' => 'right', // 'right', 'left'. stick to right or left bottom control corner
'showArrow' => true, // enable arrow down 'showArrow' => true, // enable arrow down
'data-qui' => 'package/quiqqer/bricks/bin/Controls/LanguageSwitches/DropDown',
'flagFolderPath' => URL_BIN_DIR.'16x16/flags/' 'flagFolderPath' => URL_BIN_DIR.'16x16/flags/'
]); ]);
...@@ -75,7 +74,7 @@ public function getBody() ...@@ -75,7 +74,7 @@ public function getBody()
$langs = $Project->getLanguages(); $langs = $Project->getLanguages();
$counter = 0; $counter = 0;
$showDropdown = true; $showDropdown = false;
foreach ($langs as $lang) { foreach ($langs as $lang) {
$a = $Site->existLang($lang); $a = $Site->existLang($lang);
...@@ -84,8 +83,9 @@ public function getBody() ...@@ -84,8 +83,9 @@ public function getBody()
} }
} }
if ($counter <= 1) { if ($counter > 1) {
$showDropdown = false; $showDropdown = true;
$this->setJavaScriptControl('package/quiqqer/bricks/bin/Controls/LanguageSwitches/DropDown');
} }
$Engine->assign([ $Engine->assign([
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren