|
@@ -66,6 +66,7 @@ export default {
|
|
|
name: 'AudioPreview',
|
|
|
components: { AudioPlay },
|
|
|
mixins: [PreviewMixin],
|
|
|
+ inject: ['getDragStatus'],
|
|
|
data() {
|
|
|
return {
|
|
|
data: getAudioData(),
|
|
@@ -115,9 +116,12 @@ export default {
|
|
|
if (!canvasElement) return;
|
|
|
const instanceName = `observer_${this.elementID}`;
|
|
|
this.observersMap[instanceName] = new ResizeObserver((entries) => {
|
|
|
+ if (!this.getDragStatus()) return;
|
|
|
for (let entry of entries) {
|
|
|
- this.elementWidth = entry.contentRect.width;
|
|
|
- this.elementHeight = entry.contentRect.height;
|
|
|
+ window.requestAnimationFrame(() => {
|
|
|
+ this.elementWidth = entry.contentRect.width;
|
|
|
+ this.elementHeight = entry.contentRect.height;
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
this.observersMap[instanceName].observe(this.$el);
|