mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 置顶,置低逻辑弄反了
This commit is contained in:
parent
c99663a3e8
commit
586711b9bd
@ -556,9 +556,9 @@ class Editor extends BaseService {
|
|||||||
const brothers: MNode[] = parent?.items || [];
|
const brothers: MNode[] = parent?.items || [];
|
||||||
const index = brothers.findIndex((item) => `${item.id}` === `${node?.id}`);
|
const index = brothers.findIndex((item) => `${item.id}` === `${node?.id}`);
|
||||||
|
|
||||||
if (offset === LayerOffset.BOTTOM) {
|
if (offset === LayerOffset.TOP) {
|
||||||
brothers.splice(brothers.length - 1, 0, brothers.splice(index, 1)[0]);
|
brothers.splice(brothers.length - 1, 0, brothers.splice(index, 1)[0]);
|
||||||
} else if (offset === LayerOffset.TOP) {
|
} else if (offset === LayerOffset.BOTTOM) {
|
||||||
brothers.splice(0, 0, brothers.splice(index, 1)[0]);
|
brothers.splice(0, 0, brothers.splice(index, 1)[0]);
|
||||||
} else {
|
} else {
|
||||||
brothers.splice(index + parseInt(`${offset}`, 10), 0, brothers.splice(index, 1)[0]);
|
brothers.splice(index + parseInt(`${offset}`, 10), 0, brothers.splice(index, 1)[0]);
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
||||||
import { SELECTED_CLASS, ZIndex } from './const';
|
|
||||||
import StageCore from './StageCore';
|
import StageCore from './StageCore';
|
||||||
import type { Runtime, RuntimeWindow, StageRenderConfig } from './types';
|
import type { Runtime, RuntimeWindow, StageRenderConfig } from './types';
|
||||||
import { getHost, isSameDomain } from './util';
|
import { getHost, isSameDomain } from './util';
|
||||||
@ -122,16 +121,5 @@ export default class StageRender extends EventEmitter {
|
|||||||
this.iframe?.contentDocument?.body?.appendChild(el);
|
this.iframe?.contentDocument?.body?.appendChild(el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.contentWindow) {
|
|
||||||
const style = this.contentWindow.document.createElement('style');
|
|
||||||
style.id = 'tmagic-stage-render';
|
|
||||||
style.innerHTML = `
|
|
||||||
.${SELECTED_CLASS}, .${SELECTED_CLASS}-parent {
|
|
||||||
z-index: ${ZIndex.SELECTED_EL};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
this.contentWindow.document.head.appendChild(style);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user