diff --git a/app/imports/ui/dialogStack/DialogBase.Story.vue b/app/imports/ui/dialogStack/DialogBase.Story.vue index 9f519dc7..e060c994 100644 --- a/app/imports/ui/dialogStack/DialogBase.Story.vue +++ b/app/imports/ui/dialogStack/DialogBase.Story.vue @@ -4,7 +4,8 @@ Test Dialog
- Open Dialog + Open Dialog + Open Dialog
diff --git a/app/imports/ui/dialogStack/DialogBase.vue b/app/imports/ui/dialogStack/DialogBase.vue index 8c64eb62..62da66c0 100644 --- a/app/imports/ui/dialogStack/DialogBase.vue +++ b/app/imports/ui/dialogStack/DialogBase.vue @@ -1,20 +1,25 @@ diff --git a/app/imports/ui/dialogStack/DialogStack.Story.vue b/app/imports/ui/dialogStack/DialogStack.Story.vue index e5068bd6..584c66c0 100644 --- a/app/imports/ui/dialogStack/DialogStack.Story.vue +++ b/app/imports/ui/dialogStack/DialogStack.Story.vue @@ -1,7 +1,9 @@ diff --git a/app/imports/ui/dialogStack/DialogStack.vue b/app/imports/ui/dialogStack/DialogStack.vue index 1e78c570..89e45b97 100644 --- a/app/imports/ui/dialogStack/DialogStack.vue +++ b/app/imports/ui/dialogStack/DialogStack.vue @@ -1,10 +1,12 @@ @@ -35,7 +38,7 @@ import Vue from "vue"; const OFFSET = 16; - const MOCK_DURATION = 8000; // Keep in sync with css transition of .dialog + const MOCK_DURATION = 400; // Keep in sync with css transition of .dialog export default { computed: { @@ -64,7 +67,7 @@ // Get the original styles so we can repair them later let originalStyle = { transform: target.style.transform, - background: target.style.background, + backgroundColor: target.style.backgroundColor, borderRadius: target.style.borderRadius, transition: target.style.transition, boxShadow: target.style.boxShadow, @@ -73,21 +76,21 @@ // hide the source source.style.transition = "none"; - source.style.visibility = "hidden"; + source.style.opacity = "0"; // Instantly mock the source target.style.transition = 'none'; mockElement({source, target}); - // After a full tick, repair the original styles - Vue.nextTick(() => { + // on the next animation frame, repair the styles + requestAnimationFrame(() => { target.style.transform = originalStyle.transform; - target.style.background = originalStyle.background; + target.style.backgroundColor = originalStyle.backgroundColor; target.style.borderRadius = originalStyle.borderRadius; target.style.transition = originalStyle.transition; target.style.boxShadow = originalStyle.boxShadow; source.style.transition = originalStyle.sourceTransition; - setTimeout(done, MOCK_DURATION); + setTimeout(() => done, MOCK_DURATION); }); }, leave(target, done){ @@ -101,8 +104,17 @@ mockElement({source, target}); } setTimeout(() => { - source.style.visibility = null; - done(); + let originalTransition = source.style.transition; + source.style.opacity = null; + source.style.transition = 'none'; + target.style.transition = `opacity ${MOCK_DURATION / 4}ms, pointer-events 0s` + requestAnimationFrame(() => { + source.style.transition = originalTransition; + target.style.opacity = "0"; + target.style.pointerEvents = "none"; + target.style.setProperty('box-shadow', "none", 'important'); + setTimeout(done, MOCK_DURATION / 4); + }); }, MOCK_DURATION); } }, @@ -110,6 +122,22 @@