Merge pull request #851 from dod-ccpo/modal-freezing

Fix modal freezing fix
This commit is contained in:
George Drummond
2019-06-04 11:43:40 -04:00
committed by GitHub
5 changed files with 25 additions and 26 deletions

View File

@@ -89,7 +89,18 @@ const app = new Vue({
if (data['isOpen']) {
document.body.className += ' modal-open'
this.activeModal = data['name']
var handler = ally.maintain.disabled({
filter: `#${this.modalId}`,
})
this.allyHandler = handler
} else {
this.activeModal = null
if (this.allyHandler) {
this.allyHandler.disengage()
this.allyHandler = null
}
document.body.className = document.body.className.replace(
' modal-open',
''

View File

@@ -3,19 +3,11 @@ import ally from 'ally.js'
export default {
methods: {
closeModal: function(name) {
this.activeModal = null
this.$root.$emit('modalOpen', { isOpen: false, name: name })
if (this.allyHandler) this.allyHandler.disengage()
},
openModal: function(name) {
this.activeModal = name
this.$root.$emit('modalOpen', { isOpen: true, name: name })
const idSelector = `#${this.modalId}`
this.allyHandler = ally.maintain.disabled({
filter: idSelector,
})
},
// TODO: activeModal should be tracked on the root