Skip to content

Commit

Permalink
Add jquery if debugger is enabled (Fix #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbinjohansson committed Feb 11, 2018
1 parent 458cb4a commit 6428f09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion haywire.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ public function onTwigSiteVariables()

if (file_exists($manifest)) {
$assets = json_decode(file_get_contents($manifest), true);
$this->grav['assets']->addJs('theme://dist/' . $assets['/js/app.js'], ['group' => 'bottom']);
$this->grav['assets']->addJs('theme://dist/' . $assets['/js/app.js'],10);
$this->grav['assets']->addCss('theme://dist/' . $assets['/css/app.css'],10);
}

// Add jquery if debugger is enabled
if ($this->config->get('system.debugger.enabled')) {
$this->grav['assets']->addJs('jquery',101);
}
}

public function onPageInitialized()
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
{% include 'partials/footer.html.twig' %}
</div>

{{ assets.js('bottom') }}
{{ assets.js() }}
</body>
</html>

0 comments on commit 6428f09

Please sign in to comment.