nighty
is it possible to get the current theme-mode: [light/dark] variable in a controller?
public function renderThemeMode(){
$script = new SVGScript("
var theme = localStorage.getItem('theme');
var items = document.getElementsByClassName('backgroundColor');
console.log(theme); if(theme == 'dark'){ for(i = 0; i < items.length; i++) { items[i].style.fill = '".self::$backgroundColorDark."'; }
} else { for(i = 0; i < items.length; i++) { items[i].style.fill = '".self::$backgroundColorLight."'; } }"); $this->doc->addChild($script); }
console.log(theme); if(theme == 'dark'){ for(i = 0; i < items.length; i++) { items[i].style.fill = '".self::$backgroundColorDark."'; }
} else { for(i = 0; i < items.length; i++) { items[i].style.fill = '".self::$backgroundColorLight."'; } }"); $this->doc->addChild($script); }
15 replies
is it possible to get the current theme-mode: [light/dark] variable in a controller?
incomplete Snippet - but in the SVG itself, it could be determinded at least if it´s dark or light - the problem is still, we dont know if system == light or dark
15 replies
Setting navigation group as collapsed by default
foreach($arrNavGroup as $group){
$group->collapsible(true)->collapsed(true);
#dd($group); //collapsible is applied
$builder->group($group);
}
return $builder;
//collapsible flag gone after return13 replies
Setting navigation group as collapsed by default
Hello, i have to ask again ... i have a similar problem and want to collapse some NavigationGroups on loading ... in my case if i add ->collapsed() nothing changed, i am also using only a AdminPanelProvider for Navigation generation. i checked the NavigationItems with dd() and they get the corret settings - for me, it seems if the are feed back into the builder instance, this setting get completely lost.
13 replies