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
Repeater - Array to String Conversion when save - logImplodeAssoc
when converting the array for logging ... it converts only one level - if multidimensional array comes to this function it breaks - i think it has to be fixed in filament source
11 replies
Repeater - Array to String Conversion when save - logImplodeAssoc
if i change the function this way, the error is gone:
/**
* Format an assoc array as a key/value string for logging
* @return string
*/
public static function logImplodeAssoc(array $attrs): string {
$l = '';
foreach( $attrs as $k => $v ) {
/* changes Start */
if(is_array($v)){
continue;
} /* change End */
$l .= "{ $k => $v } ";
}
return $l;
}
11 replies