Skip to content

Commit

Permalink
separate styles and scripts (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidely authored May 8, 2024
1 parent cf3f4c5 commit 7294d18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@
}
},
"ResourceModules": {
"ext.networknotice.Notice": {
"ext.networknotice.Notice.styles": {
"styles": [
"styles/ext.networknotice.Notice.less"
],
"position": "bottom"
},
"ext.networknotice.Notice.scripts": {
"scripts": [
"scripts/ext.networknotice.Notice.js"
],
Expand Down
3 changes: 2 additions & 1 deletion src/Hooks/MainHookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class MainHookHandler implements
* @param Skin $skin
*/
public function onBeforePageDisplay( $out, $skin ): void {
$out->addModules( 'ext.networknotice.Notice' );
$out->addModuleStyles( 'ext.networknotice.Notice.styles' );
$out->addModules( 'ext.networknotice.Notice.scripts' );
}

/**
Expand Down

0 comments on commit 7294d18

Please sign in to comment.