Add behavior list component

This commit is contained in:
2022-03-27 21:35:28 +08:00
parent a36a10dade
commit 4a52fc723e
2 changed files with 16 additions and 1 deletions
+7 -1
View File
@@ -78,6 +78,9 @@ class Popup extends Component<IPopupProps & IMixinStatusProps & IMixinSettingPro
popup.isOnMouseDown = true; popup.isOnMouseDown = true;
popup.lastMouseLeft = e.clientX; popup.lastMouseLeft = e.clientX;
popup.lastMouseTop = e.clientY; popup.lastMouseTop = e.clientY;
if (this.props.status) {
this.props.status.popup.topping(popup);
}
}} }}
> >
{popup.onRenderHeader()} {popup.onRenderHeader()}
@@ -231,6 +234,9 @@ class Popup extends Component<IPopupProps & IMixinStatusProps & IMixinSettingPro
private renderLayer(popup: PopupModel) { private renderLayer(popup: PopupModel) {
const pageWidth = document.documentElement.clientWidth; const pageWidth = document.documentElement.clientWidth;
const pageHeight = document.documentElement.clientHeight; const pageHeight = document.documentElement.clientHeight;
const hasAnimate = !popup.isInit;
popup.isInit = true;
if (isNaN(popup.top)) { if (isNaN(popup.top)) {
popup.top = (pageHeight - popup.height) / 2; popup.top = (pageHeight - popup.height) / 2;
} }
@@ -248,7 +254,7 @@ class Popup extends Component<IPopupProps & IMixinStatusProps & IMixinSettingPro
left: popup.left left: popup.left
}} }}
className={getClassList({ className={getClassList({
className: "popup-layer show-scale", className: "popup-layer" + (hasAnimate ? " show-scale" : ""),
backgroundLevel: BackgroundLevel.Level4, backgroundLevel: BackgroundLevel.Level4,
}, this.props.setting).join(" ")} }, this.props.setting).join(" ")}
> >
+9
View File
@@ -43,6 +43,7 @@ class Popup<P extends IAnyObject = IAnyObject> {
public isResizeMouseDown: boolean = false; public isResizeMouseDown: boolean = false;
public isResizeOverFlowX: boolean = false; public isResizeOverFlowX: boolean = false;
public isResizeOverFlowY: boolean = false; public isResizeOverFlowY: boolean = false;
public isInit = false;
/** /**
* 是否关闭 * 是否关闭
@@ -129,6 +130,14 @@ class PopupController extends Emitter<IPopupControllerEvent> {
*/ */
public popups: Popup[] = []; public popups: Popup[] = [];
/**
* 指定弹窗
*/
public topping(popup: Popup) {
popup.index = Infinity;
this.sortPopup();
}
/** /**
* 排序并重置序号 * 排序并重置序号
*/ */