fix(project): keep sidebar on week navigation
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/* 오른쪽 회의록 안의 주차·달 이동도 왼쪽 메뉴를 유지하도록 부모 화면에 전달한다. */
|
||||
(function () {
|
||||
"use strict";
|
||||
if (window.parent === window) return;
|
||||
document.addEventListener("click", function (event) {
|
||||
const link = event.target.closest("a[href]");
|
||||
if (!link || event.defaultPrevented || event.button || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
|
||||
const url = new URL(link.href, location.href);
|
||||
if (url.origin !== location.origin) return;
|
||||
if (/^\/project\/goals\/\d{4}\/meetings\/\d{1,2}$/.test(url.pathname)) {
|
||||
event.preventDefault();
|
||||
url.searchParams.delete("content");
|
||||
window.parent.postMessage({ type: "pj-meeting-navigate", href: url.href }, location.origin);
|
||||
} else if (/^\/project\/goals\/\d{4}$/.test(url.pathname)) {
|
||||
// 연간 목표로 돌아갈 때는 중첩 메뉴가 생기지 않도록 바깥 화면에서 연다.
|
||||
link.target = "_top";
|
||||
}
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user