Skip to content

Commit

Permalink
fix v-modals and fix audio assets
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephShepin committed Apr 16, 2022
1 parent b16ba15 commit ddd7e65
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/components/Checkbox.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="checkbox-container" @click="$emit('input', !value)">
<div class="checkbox" :class="{ checked: value }">
<div class="checkbox-container" @click="$emit('update:modelValue', !modelValue)">
<div class="checkbox" :class="{ checked: modelValue }">
<font-awesome-icon class="check" :icon="faCheck" />
</div>

Expand All @@ -15,7 +15,7 @@ import { faCheck } from '@fortawesome/free-solid-svg-icons';
export default {
props: {
value: { type: Boolean, required: true },
modelValue: { type: Boolean, required: true },
labelSize: { type: String, default: '.85em' },
},
data() {
Expand Down
2 changes: 1 addition & 1 deletion src/views/GpaCalculator/GpaCalculator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<div class="final-gpa">{{course.weightedGPA.toFixed(2)}}</div>
</div>
</div>
<checkbox :value="course.weight == 1.5" v-on:input="toggleExtraWeight(course, $event)">1.5 Weight Science Class</checkbox>
<checkbox :modelValue="course.weight == 1.5" v-on:update:modelValue="toggleExtraWeight(course, $event)">1.5 Weight Science Class</checkbox>
<br>
</card>
</card-container>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Settings/Add Schedule/ScheduleColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<rounded-button class="add-period-button" :icon="icons.faPlus" text="Add Period" @click="$emit('add-period')" />

<checkbox :value="isEnabled" @input="$emit($event ? 'enable' : 'disable')">
<checkbox :modelValue="isEnabled" @update:modelValue="$emit($event ? 'enable' : 'disable')">
<span class="enable-checkbox-text">This schedule applies on days of type "{{ name }}"</span>
</checkbox>

Expand Down
10 changes: 6 additions & 4 deletions src/views/Settings/Transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@
</div>
</confirm-popup>

<p>{{shouldSaveSetting}}</p>
<confirm-popup :show="popupToShow == popups.save" ok-text="Save" @cancel="cancel" @ok="save">
<div class="save-popup">
<div class="title">Choose what to save:</div>

<!-- <checkbox // FIX
<!-- fix -->
<checkbox
v-for="(_, setting) in shouldSaveSetting"
:key="setting"
v-model="shouldSaveSetting[setting]"
>
{{ settingToName(setting) }}
</checkbox> -->
</checkbox>

<div class="warning">Warning: Any existing data will be lost</div>
</div>
Expand All @@ -65,7 +66,7 @@

<script>
import { faUpload, faDownload, faSpinner } from '@fortawesome/free-solid-svg-icons';
import Vue from 'vue';
// import Vue from 'vue';
import RoundedButton from '@/components/RoundedButton.vue';
import Popup from '@/components/Popup.vue';
Expand Down Expand Up @@ -121,6 +122,7 @@ export default {
created() {
// Initialize each property of shouldSendSetting to true (meaning that all send checkboxes will be checked initially)
tranferableSettings.forEach((str) => { // FIX
this.shouldSendSetting[str] = true;
// Vue.set(this.shouldSendSetting, str, true); // need use Vue.set since we're adding dynamic properties to a tracked object
});
},
Expand Down
7 changes: 2 additions & 5 deletions src/views/Tools/TimerCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ import Checkbox from '@/components/Checkbox.vue';
import ConfirmPopup from '@/components/ConfirmPopup.vue';
import WhatIsThis from '@/components/WhatIsThis.vue';
import { blankAudioFile } from '@/assets/blank.mp3';
import { timerAudioFile } from '@/assets/timer.mp3';
// FIX
export default {
components: {
Card,
Expand Down Expand Up @@ -148,10 +145,10 @@ export default {
shouldMakeSound() {
if (this.shouldMakeSound && !this.audio) {
// initially playing some blank audio while tab is in focus allows audio to be played later even when tab is in background
const blankAudio = new Audio(blankAudioFile);
const blankAudio = new Audio('blank.mp3');
blankAudio.play();
this.audio = new Audio(timerAudioFile);
this.audio = new Audio('timer.mp3');
}
},
},
Expand Down

0 comments on commit ddd7e65

Please sign in to comment.