From e0285b81a38a027b8b6b9c6d3cfe55473fed3886 Mon Sep 17 00:00:00 2001 From: ArrayIterator <37867551+ArrayIterator@users.noreply.github.com> Date: Fri, 19 Jul 2024 21:20:48 +0700 Subject: [PATCH] Update AssetsJsCssQueue.php --- src/Assets/AssetsJsCssQueue.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Assets/AssetsJsCssQueue.php b/src/Assets/AssetsJsCssQueue.php index 855b808..d8d3164 100644 --- a/src/Assets/AssetsJsCssQueue.php +++ b/src/Assets/AssetsJsCssQueue.php @@ -239,6 +239,17 @@ private function doRegisterExtendedCss(string $name) : void } } + private function doRegisterExtendedJS(string $name) : void + { + // if contain on extended + if (!isset($this->extended[$name])) { + return; + } + foreach ($this->extended[$name]['js']??[] as $cssName => $inherit) { + $this->queue['js'][$cssName] ??= $inherit; + } + } + public function queueHeaderJs( string $name, string ...$inherits @@ -256,7 +267,7 @@ public function queueFooterJs( $this->queuedRecord['js'][$name] = true; $this->queue['js_footer'][$name] = $inherits; unset($this->queue['js_header'][$name]); - $this->doRegisterExtendedCss($name); + $this->doRegisterExtendedJS($name); } public function renderHeader(): string