fix(client): Handle null of rootEl in MkWindow.vue (#9326)

* fix(client): Handle null of rootEl in MkWindow.vue

* comment

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
tamaina 2022-12-18 19:52:50 +09:00 committed by GitHub
parent 867e31c9ff
commit 88859cf67d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,6 +221,8 @@ function onHeaderMousedown(evt: MouseEvent) {
//
function onTopHandleMousedown(evt) {
const main = rootEl;
// null
if (main == null) return;
const base = evt.clientY;
const height = parseInt(getComputedStyle(main, '').height, 10);
@ -247,6 +249,7 @@ function onTopHandleMousedown(evt) {
//
function onRightHandleMousedown(evt) {
const main = rootEl;
if (main == null) return;
const base = evt.clientX;
const width = parseInt(getComputedStyle(main, '').width, 10);
@ -271,6 +274,7 @@ function onRightHandleMousedown(evt) {
//
function onBottomHandleMousedown(evt) {
const main = rootEl;
if (main == null) return;
const base = evt.clientY;
const height = parseInt(getComputedStyle(main, '').height, 10);
@ -295,6 +299,7 @@ function onBottomHandleMousedown(evt) {
//
function onLeftHandleMousedown(evt) {
const main = rootEl;
if (main == null) return;
const base = evt.clientX;
const width = parseInt(getComputedStyle(main, '').width, 10);
@ -366,6 +371,8 @@ function applyTransformLeft(left) {
function onBrowserResize() {
const main = rootEl;
if (main == null) return;
const position = main.getBoundingClientRect();
const browserWidth = window.innerWidth;
const browserHeight = window.innerHeight;