Refine BIM comment modal constraints
This commit is contained in:
+11
-10
@@ -553,6 +553,13 @@ const setCommentModalError = (message = "") => {
|
||||
commentModalError.hidden = !text;
|
||||
};
|
||||
|
||||
const setCommentModalSubtitle = (text = "") => {
|
||||
if (!commentModalSubtitle) return;
|
||||
const value = String(text || "").trim();
|
||||
commentModalSubtitle.textContent = value;
|
||||
commentModalSubtitle.hidden = !value;
|
||||
};
|
||||
|
||||
const bringFloatingWindowToFront = (id) => {
|
||||
if (!id) return;
|
||||
floatingWindowOrder = [...floatingWindowOrder.filter((item) => item !== id), id];
|
||||
@@ -1233,9 +1240,7 @@ const openCommentModalForTarget = () => {
|
||||
commentTitleInput && (commentTitleInput.value = "");
|
||||
commentBodyInput && (commentBodyInput.value = "");
|
||||
commentReplyInput && (commentReplyInput.value = "");
|
||||
if (commentModalSubtitle) {
|
||||
commentModalSubtitle.textContent = "BIM-COMMENT";
|
||||
}
|
||||
setCommentModalSubtitle();
|
||||
if (commentModalEditedMeta) {
|
||||
const [x, y, z] = commentContextTarget.worldPos || [];
|
||||
commentModalEditedMeta.textContent = Number.isFinite(x)
|
||||
@@ -1263,9 +1268,7 @@ const openCommentModalForComment = (commentId) => {
|
||||
commentTitleInput && (commentTitleInput.value = comment.title || "");
|
||||
commentBodyInput && (commentBodyInput.value = comment.body || "");
|
||||
commentReplyInput && (commentReplyInput.value = "");
|
||||
if (commentModalSubtitle) {
|
||||
commentModalSubtitle.textContent = comment.id || "BIM-COMMENT";
|
||||
}
|
||||
setCommentModalSubtitle();
|
||||
if (commentModalEditedMeta) {
|
||||
commentModalEditedMeta.textContent = `Последнее редактирование: ${formatDateTime(comment.updatedAt || comment.createdAt)}`;
|
||||
}
|
||||
@@ -1344,9 +1347,7 @@ const syncCommentModalAfterSave = (comment) => {
|
||||
commentDraftSubitems = Array.isArray(comment.subitems)
|
||||
? comment.subitems.map((item) => ({ ...item }))
|
||||
: [];
|
||||
if (commentModalSubtitle) {
|
||||
commentModalSubtitle.textContent = comment.id || "BIM-COMMENT";
|
||||
}
|
||||
setCommentModalSubtitle();
|
||||
if (commentModalEditedMeta) {
|
||||
commentModalEditedMeta.textContent = `Последнее редактирование: ${formatDateTime(comment.updatedAt || comment.createdAt)}`;
|
||||
}
|
||||
@@ -5658,7 +5659,7 @@ const loadProjectSnapshot = async (project) => {
|
||||
registerFloatingWindowElement("commentModal", commentModal);
|
||||
setupDraggableFixedWindow(commentsPanel, commentsPanelHeader);
|
||||
setupDraggableFixedWindow(commentModal, commentModalHeader);
|
||||
setupResizableFixedWindow(commentModal, { minWidth: 560, minHeight: 420 });
|
||||
setupResizableFixedWindow(commentModal, { minWidth: 660, minHeight: 420 });
|
||||
commentsCollapseButton?.addEventListener("click", () => setCommentsCollapsed(true));
|
||||
commentsRestoreButton?.addEventListener("click", () => {
|
||||
commentsModeActive = true;
|
||||
|
||||
Reference in New Issue
Block a user