Skip to content

Commit

Permalink
Merge branch 'master' into GI#94-ask-app-review
Browse files Browse the repository at this point in the history
  • Loading branch information
ElNinjaGaiden committed Oct 2, 2018
2 parents c907e89 + 5af0dc7 commit d2531b7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/mixins/hasModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ export default {
next(!this.isModalOpen)
},
methods: {
toggleModal() {
toggleModal(modalComponent = null) {
if (!this.isModalOpen) {
this.openModal()
this.openModal(modalComponent)
}
this.isModalOpen = !this.isModalOpen
},
async openModal() {
const modal = await this.$ionic.modalController.create({ component: this.modal })
async openModal(modalComponent = null) {
const modal = await this.$ionic.modalController.create({
component: modalComponent || this.modal,
})
modal.present()
return modal.onDidDismiss().then(this.toggleModal)
},
Expand Down
5 changes: 4 additions & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</div>
</div>
</div>
<h2 @click="toggleModal"><span>How does it work?</span></h2>
<h2 @click="goToHelp"><span>How does it work?</span></h2>
</ion-content>
</ion-page>
</template>
Expand Down Expand Up @@ -66,6 +66,9 @@ export default {
App.exitApp()
},
goToHelp() {
this.toggleModal()
},
},
mounted() {
this.modal = () => import('@/components/HowDoesItWorkModal.vue')
Expand Down
5 changes: 4 additions & 1 deletion src/views/Pwd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<input type="submit" class="form-submit-button"/>
</form>
</div>
<div class="hash-protected-holder" @click="toggleModal">
<div class="hash-protected-holder" @click="goToHelp">
<div class="hash-protected-inner">
<img class="hash-protected-img" src="../images/Icon-Hash-Protected.svg" alt="Hash protected"/>
<span>Hash protected</span>
Expand Down Expand Up @@ -156,6 +156,9 @@ export default {
return breachData[1]
},
goToHelp() {
this.toggleModal()
},
},
}
</script>
Expand Down
5 changes: 4 additions & 1 deletion src/views/Unsafe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
v-html="count"/>
<h2 class="count-text">websites</h2>
<div id="lottie"></div>
<h3 @click="toggleModal">
<h3 @click="goToHelp">
<span>What should you do?</span>
</h3>
<h3 @click="goToAcc">
Expand Down Expand Up @@ -74,6 +74,9 @@ export default {
name: 'unsafe',
})
},
goToHelp() {
this.toggleModal()
},
},
}
</script>
Expand Down

0 comments on commit d2531b7

Please sign in to comment.