Xóa scene con mà không xóa scene cha
This commit is contained in:
@@ -167,10 +167,15 @@ function applyViewerSecurity() {
|
||||
const panoramaViewer = document.getElementById('panorama-viewer');
|
||||
|
||||
const handleContextMenu = (e) => {
|
||||
// Nếu click trúng vào hotspot hiện có thì không xử lý tại đây
|
||||
// để listener của hotspot (trong renderCustomHotspot) được chạy.
|
||||
if (e.target.closest('.pnlm-custom-hotspot')) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
return false; // Ngăn chặn menu chuột phải mặc định của trình duyệt
|
||||
|
||||
// Nếu viewer đang hoạt động, lấy tọa độ Pitch/Yaw tại điểm click
|
||||
if (activeViewer) {
|
||||
@@ -203,8 +208,8 @@ function applyViewerSecurity() {
|
||||
};
|
||||
|
||||
// Sử dụng capture phase (true) để bắt sự kiện trước khi nó chạm đến Pannellum
|
||||
// container.addEventListener('contextmenu', handleContextMenu, true); // Bỏ gắn sự kiện này
|
||||
// panoramaViewer.addEventListener('contextmenu', handleContextMenu, true); // Bỏ gắn sự kiện này
|
||||
container.addEventListener('contextmenu', handleContextMenu, true);
|
||||
panoramaViewer.addEventListener('contextmenu', handleContextMenu, true);
|
||||
|
||||
// Block drag and drop
|
||||
container.addEventListener('dragstart', (e) => {
|
||||
|
||||
Reference in New Issue
Block a user