Stopped dialog animation mocking transparent elements' background color

This commit is contained in:
Stefan Zermatten
2021-01-22 12:20:33 +02:00
parent a4e6dd1d66
commit 100c93b5ae
2 changed files with 6 additions and 5 deletions

View File

@@ -42,8 +42,6 @@
</template>
<script>
import Vue from 'vue';
import anime from 'animejs';
import '/imports/ui/dialogStack/dialogStackWindowEvents.js';
import mockElement from '/imports/ui/dialogStack/mockElement.js';
import DialogComponentIndex from '/imports/ui/dialogStack/DialogComponentIndex.js';

View File

@@ -48,8 +48,11 @@ export default function mockElement({source, target, offset = {x: 0, y: 0}}){
// Mock the source
target.style.transform = `translate(${deltaLeft}px, ${deltaTop}px) ` +
`scale(${deltaWidth}, ${deltaHeight})`;
target.style.backgroundColor = getComputedStyle(source).backgroundColor;
// Mock the background color unless it's completely transparent
let backgroundColor = getComputedStyle(source).backgroundColor
if (backgroundColor !== 'rgba(0, 0, 0, 0)'){
target.style.backgroundColor = backgroundColor;
}
// Edge might not combine all border radii into a single value,
// So we just sample the top left one if we need to
let oldRadius = getComputedStyle(source).borderRadius ||
@@ -60,4 +63,4 @@ export default function mockElement({source, target, offset = {x: 0, y: 0}}){
getComputedStyle(source).boxShadow, deltaWidth, deltaHeight
);
target.style.setProperty('box-shadow', boxShadow, 'important');
};
}