Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zambezi-marketing committed Mar 6, 2023
1 parent 62c2913 commit 32cd577
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions AlpineJS.module
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ class AlpineJS extends ModuleJS implements Module
);
}

// Update when https://github.com/processwire/processwire/pull/210 is merged

public function init()
{
$config = $this->config;
bd($this->page->template);
if( $this->page->template == "admin") {
$this->wire()->adminTheme->addExtraMarkup('head', "<script src='{$this->getVersionUrl()}' defer></script>");
}
}


// Update when https://github.com/processwire/processwire/pull/210 is merged

public function url($path)
{
Expand Down Expand Up @@ -44,7 +55,6 @@ class AlpineJS extends ModuleJS implements Module
$class = $this->className();
$versions_path = "{$this->config->paths->$class}alpinejs/";


//bd($versions_path);
if (!$this->version) {
$files = $this->files->find($versions_path, [
Expand All @@ -63,12 +73,4 @@ class AlpineJS extends ModuleJS implements Module
}
}

public function init()
{
$config = $this->config;
$this->wire()->adminTheme->addExtraMarkup('head', "<script src='{$this->getVersionUrl()}' defer></script>");
//$config->scripts->add($this->getVersionUrl(), ['defer' => true]);
//$config->scripts->add($this->getVersionUrl(), "defer");
}

}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "elabx/modulejs-alpinejs",
"name": "elabx/processwire-alpinejs",
"description": "Add AlpineJS to ProcessWire admin",
"type": "pw-module",
"keywords": ["processwire"],
Expand Down

0 comments on commit 32cd577

Please sign in to comment.