mirror of
https://github.com/nasa/openmct.git
synced 2025-02-07 11:30:28 +00:00
Add resize event and disable pointer events on iframes on trigger of resize (#4016)
This commit is contained in:
parent
b3ceccd7fb
commit
10da314a4a
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
<multipane
|
<multipane
|
||||||
class="l-shell__main"
|
class="l-shell__main"
|
||||||
|
:class="[resizingClass]"
|
||||||
type="horizontal"
|
type="horizontal"
|
||||||
>
|
>
|
||||||
<pane
|
<pane
|
||||||
@ -53,6 +54,8 @@
|
|||||||
handle="after"
|
handle="after"
|
||||||
label="Browse"
|
label="Browse"
|
||||||
collapsable
|
collapsable
|
||||||
|
@start-resizing="onStartResizing"
|
||||||
|
@end-resizing="onEndResizing"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
slot="controls"
|
slot="controls"
|
||||||
@ -102,6 +105,8 @@
|
|||||||
handle="before"
|
handle="before"
|
||||||
label="Inspect"
|
label="Inspect"
|
||||||
collapsable
|
collapsable
|
||||||
|
@start-resizing="onStartResizing"
|
||||||
|
@end-resizing="onEndResizing"
|
||||||
>
|
>
|
||||||
<Inspector
|
<Inspector
|
||||||
ref="inspector"
|
ref="inspector"
|
||||||
@ -157,12 +162,16 @@ export default {
|
|||||||
actionCollection: undefined,
|
actionCollection: undefined,
|
||||||
triggerSync: false,
|
triggerSync: false,
|
||||||
triggerReset: false,
|
triggerReset: false,
|
||||||
headExpanded
|
headExpanded,
|
||||||
|
isResizing: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
toolbar() {
|
toolbar() {
|
||||||
return this.hasToolbar && this.isEditing;
|
return this.hasToolbar && this.isEditing;
|
||||||
|
},
|
||||||
|
resizingClass() {
|
||||||
|
return this.isResizing ? 'l-shell__resizing' : '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -240,6 +249,12 @@ export default {
|
|||||||
},
|
},
|
||||||
handleTreeReset() {
|
handleTreeReset() {
|
||||||
this.triggerReset = !this.triggerReset;
|
this.triggerReset = !this.triggerReset;
|
||||||
|
},
|
||||||
|
onStartResizing() {
|
||||||
|
this.isResizing = true;
|
||||||
|
},
|
||||||
|
onEndResizing() {
|
||||||
|
this.isResizing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -293,6 +293,12 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: $p;
|
padding: $p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__resizing {
|
||||||
|
iframe {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-editing {
|
.is-editing {
|
||||||
|
@ -126,12 +126,14 @@ export default {
|
|||||||
document.body.addEventListener('mousemove', this.updatePosition);
|
document.body.addEventListener('mousemove', this.updatePosition);
|
||||||
document.body.addEventListener('mouseup', this.end);
|
document.body.addEventListener('mouseup', this.end);
|
||||||
this.resizing = true;
|
this.resizing = true;
|
||||||
|
this.$emit('start-resizing');
|
||||||
this.trackSize();
|
this.trackSize();
|
||||||
},
|
},
|
||||||
end: function (event) {
|
end: function (event) {
|
||||||
document.body.removeEventListener('mousemove', this.updatePosition);
|
document.body.removeEventListener('mousemove', this.updatePosition);
|
||||||
document.body.removeEventListener('mouseup', this.end);
|
document.body.removeEventListener('mouseup', this.end);
|
||||||
this.resizing = false;
|
this.resizing = false;
|
||||||
|
this.$emit('end-resizing');
|
||||||
this.trackSize();
|
this.trackSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user