Skip to content

Commit

Permalink
Use window property for global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
KiOui committed Sep 6, 2023
1 parent 0b0cccc commit 052a4eb
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion website/orders/templates/orders/order_admin_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h3 class="mt-3">Orders total</h3>

<script type="module">
import { createApp } from 'vue';
let orders_vue_{{ shift.id }} = createApp({
window.orders_vue_{{ shift.id }} = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion website/orders/templates/orders/shift_admin_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<script type="module">
import { createApp } from 'vue';
let admin_footer_vue_{{ shift.id }} = createApp({
window.admin_footer_vue_{{ shift.id }} = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
6 changes: 4 additions & 2 deletions website/orders/templates/orders/shift_admin_scanner.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@
<script src="{% static "orders/js/quagga.min.js" %}"></script>
<script src="{% static "orders/js/admin-scanner.js" %}"></script>

<script>
const POPUP_MODAL_ID = "scanner-popup";
</script>
<script type="module">
import { createApp } from 'vue';
const POPUP_MODAL_ID = "scanner-popup";
let scanner_vue = createApp({
window.scanner_vue = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion website/orders/templates/orders/shift_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>{{ shift.venue.venue.name }}</h1>

<script type="module">
import { createApp } from 'vue';
let shift_header_{{ shift.id }}_vue = createApp({
window.shift_header_{{ shift.id }}_vue = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion website/thaliedje/templates/thaliedje/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</div>
<script type="module">
import { createApp } from 'vue';
let player_{{ player.id }}_vue = createApp({
window.player_{{ player.id }}_vue = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion website/thaliedje/templates/thaliedje/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<script type="module">
import { createApp } from 'vue';
let player_{{ player.id }}_queue_vue = createApp({
window.player_{{ player.id }}_queue_vue = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion website/thaliedje/templates/thaliedje/requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<script type="module">
import { createApp } from 'vue';
let player_{{ player.id }}_requests_vue = createApp({
window.player_{{ player.id }}_requests_vue = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion website/thaliedje/templates/thaliedje/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h5 class="text-uppercase">Albums</h5>

<script type="module">
import { createApp } from 'vue';
let player_{{ player.id }}_search_vue = createApp({
window.player_{{ player.id }}_search_vue = createApp({
delimiters: ['${', '}$'],
data() {
return {
Expand Down

0 comments on commit 052a4eb

Please sign in to comment.