From 6966535c7d983989fa630cbdc9a40b42ac0653f7 Mon Sep 17 00:00:00 2001 From: zero Date: Thu, 8 Mar 2007 06:03:20 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@330 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- common/js/tree_menu.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/common/js/tree_menu.js b/common/js/tree_menu.js index 35a5a3b81..7462535fc 100644 --- a/common/js/tree_menu.js +++ b/common/js/tree_menu.js @@ -34,7 +34,34 @@ var node_callback_func = new Array(); // 메뉴 클릭시 기본으로 동작할 함수 function moveTreeMenu(menu_id, node) { - alert(node.getAttribute("text")); + // url과 open_window값을 구함 + var node_srl = node.getAttribute("node_srl"); + var url = node.getAttribute("url"); + var open_window = node.getAttribute("open_window"); + var hasChild = false; + if(node.hasChildNodes()) hasChild = true; + + // url이 없고 child가 있으면 해당 폴더 토글한다 + if(!url && hasChild) { + var zone_id = "menu_"+menu_id+"_"+node_srl; + toggleFolder(zone_id); + return; + } + + // url이 있으면 url을 분석한다 (제로보드 특화된 부분. url이 http나 ftp등으로 시작하면 그냥 해당 url 열기) + if(url) { + // http, ftp등의 연결이 아닌 경우 제로보드용으로 처리 + if(url.indexOf('://')==-1) { + url = "./?"+url; + } + + // open_window에 따라서 처리 + if(open_window != "Y") location.href=url; + else { + var win = window.open(url); + win.focus(); + } + } } // 트리메뉴의 정보를 담고 있는 xml파일을 읽고 drawTreeMenu()를 호출하는 함수