From bb4f202adc7fe7128481ef54a5d66923f49c6a47 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 26 Jun 2025 10:33:30 +0400 Subject: [PATCH] =?UTF-8?q?showmore=20peut=20=C3=AAtre=20configur=C3=A9=20?= =?UTF-8?q?pour=20afficher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nur_src/v/plugins/showmorePlugin.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nur_src/v/plugins/showmorePlugin.php b/nur_src/v/plugins/showmorePlugin.php index 483a011..62f1b41 100644 --- a/nur_src/v/plugins/showmorePlugin.php +++ b/nur_src/v/plugins/showmorePlugin.php @@ -49,6 +49,13 @@ class showmorePlugin extends BasePlugin { protected ?string $onShow; + protected bool $initialShow = false; + + function show(bool $show=true): self { + $this->initialShow = $show; + return $this; + } + function startc(): array { return v::sdiv(["class" => $this->containerClass]); } @@ -56,7 +63,10 @@ class showmorePlugin extends BasePlugin { function invite($vs=null): array { $vs ??= $this->inviteContent; return v::a([ - "class" => $this->inviteClass, + "class" => [ + $this->inviteClass, + "hidden" => $this->initialShow, + ], "href" => "#", $vs, ]); @@ -64,7 +74,10 @@ class showmorePlugin extends BasePlugin { function startp(): array { return v::sdiv([ - "class" => [$this->panelClass, "hidden"], + "class" => [ + $this->panelClass, + "hidden" => !$this->initialShow, + ], ]); }