Skip to content

Commit 12800a1

Browse files
committed
Add defer_js option
1 parent 9dc39f0 commit 12800a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

action.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ public function register(Doku_Event_Handler $controller) {
3535
*/
3636
public function handle_tpl_metaheader_output(Doku_Event &$event, $param) {
3737
global $ID;
38+
global $conf;
3839

3940
// add script if user has better auth than AUTH_EDIT
4041
if ( auth_quickaclcheck( $ID ) >= AUTH_EDIT ) {
4142
$event->data['script'][] = array(
4243
'type'=> 'text/javascript', 'charset'=> 'utf-8', '_data'=> '',
4344
'src' => DOKU_BASE.'lib/exe/js.php'.'?t='.rawurlencode($conf['template']).'&type=admin&tseed='.$tseed
44-
);
45+
) + ($conf['defer_js'] ? [ 'defer' => 'defer'] : []);
4546
}
4647

4748
// The first one is the static JavaScript block. PageSpeed says it would be good to print this first.

0 commit comments

Comments
 (0)