Skip to content

Commit 60cca5b

Browse files
committed
Scope script to only the acp page needed
1 parent d979bfc commit 60cca5b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

adm/style/event/acp_overall_footer_after.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% if S_PWA_OPTIONS %}
12
<script>
23
const input = document.getElementById('pwa_short_name');
34
const maxLength = 12;
@@ -12,3 +13,4 @@
1213
}
1314
});
1415
</script>
16+
{% endif %}

event/listener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ public function acp_pwa_options($event)
169169
];
170170

171171
$event->update_subarray('display_vars', 'vars', phpbb_insert_config_array($event['display_vars']['vars'], $my_config_vars, ['before' => 'legend4']));
172+
173+
$this->template->assign_var('S_PWA_OPTIONS', true);
172174
}
173175
}
174176

0 commit comments

Comments
 (0)