Skip to content

Commit

Permalink
fix(script): 新增软件辅助功能,全面优化智慧树,共享课学习作业考试以及学分课视频
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Sep 22, 2023
1 parent c681a85 commit 18a2725
Show file tree
Hide file tree
Showing 5 changed files with 322 additions and 222 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/render/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export type ModalAttrs = Pick<
| 'modalInputType'
| 'modalStyle'
> & {
/** 取消生成窗口的关闭按钮 */
disableWrapperCloseable?: boolean;
/** 点击遮罩层是否可以关闭弹窗,默认 true */
maskCloseable?: boolean;
/** 弹窗标题 */
title?: ModalElement['title'];
/** 伴随系统通知一起弹出 */
Expand Down Expand Up @@ -426,7 +426,7 @@ export const RenderScript = new Script({
export function $modal(type: ModalElement['type'], attrs: ModalAttrs) {
if (self === top) {
const {
disableWrapperCloseable,
maskCloseable = true,
onConfirm,
onCancel,
onClose,
Expand Down Expand Up @@ -468,7 +468,7 @@ export function $modal(type: ModalElement['type'], attrs: ModalAttrs) {
modal.addEventListener('click', (e) => {
e.stopPropagation();
});
if (!disableWrapperCloseable) {
if (maskCloseable) {
/** 点击遮罩层关闭模态框 */
wrapper.addEventListener('click', () => {
onClose?.apply(modal);
Expand Down
2 changes: 2 additions & 0 deletions packages/scripts/src/projects/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export const BackgroundProject = Project.create({
}
}
},

onrender({ panel }) {
// 同步面板不会被锁定
panel.lockWrapper.remove();
Expand Down Expand Up @@ -394,6 +395,7 @@ export const BackgroundProject = Project.create({
gt(last, infos.script.version)
) {
const modal = $modal('confirm', {
maskCloseable: false,
width: 600,
content: $creator.notes([`检测到新版本发布 ${last} :`, [...(version.notes || [])]]),
footer: el('div', [
Expand Down
Loading

0 comments on commit 18a2725

Please sign in to comment.