I modified the context-menu code to try and handle this as such:
Code: Select all
var selected = _mi[_itemRef];
if(selected && selected[34] == "tree" && selected[103]) {
var treeContext = selected[103] + "_popup";
popup(treeContext,1);
}else {
_gm=getMenuByName(contextMenu)
if(_gm!=null)popup(contextMenu,1)
}
The other option would be to only expand the menu when you click on the +/- and clicking on the menu test itself would open up a popup menu of additional options. But that would seem to be much trickier and possibly involve the main milonic code which is out.
And here's my tree data, not that it will probably help much.
Code: Select all
_scrollAmount=5; // Used for Netscape 4 scrolling
_scrollDelay=10; // Used for Netscape 4 scrolling
_menuCloseDelay=500; // The delay for menus to remain visible on mouse off
_menuOpenDelay=150; // The delay for opening menus on mouse over
_subOffsetTop=0; // Sub menu offset Top position
_subOffsetLeft=0; // Sub menu offset Left position
treeOffset=17; // Used to set the offset of sub menus
singleMasterMenu=false; // Informs the system to only have one menu open at a time
with(tstyle1=new mm_style()){
menubgimage="images/tree_bg.gif";
offcolor="black";
oncolor="blue";
//clickcolor="blue";
decoration="none";
ondecoration="underline";
fontfamily="verdana,arial,tahoma";
fontsize="68%";
type="tree";
margin=0;
padding=0;
separatorsize=0;
subimage="images/tree_trans.gif"
subimageposition="top left" ;
zindex=-1;
}
with(tstyle2=new mm_style()){
//menubgimage="images/tree_bg.gif";
offcolor="black";
oncolor="blue";
//clickcolor="blue";
decoration="none";
ondecoration="underline";
fontfamily="verdana,arial,tahoma";
fontsize="68%";
type="tree";
margin=0;
padding=0;
separatorsize=0;
subimage="images/tree_trans.gif"
subimageposition="top left" ;
}
with(sectionMenuStyle=new mm_style()){
bordercolor="#9BA6C2";
borderstyle="solid";
borderwidth=0;
closeonclick=true;
fontfamily="arial, tahoma";
fontsize="12px";
fontstyle="normal";
headerbgcolor="#94BCF8";
headerborder="1px solid #1852D8";
headercolor="#000000";
itemheight=25;
imagepadding=4;
menubgcolor="#FFFFFF";
offbgcolor="transparent";
offcolor="#000000";
onbgcolor="#FEFAD2";
oncolor="#000000";
image="images/16_blank.gif"
menubgimage="images/submenu_bkg.gif";
overbgimage="images/submenu_hover_bkg.gif";
}
with(new menuname("primary_popup")){
style=sectionMenuStyle;
alwaysvisible=0;
orientation="vertical";
aI("text=Summary;");
aI("text=Update;");
aI("text=Delete;");
}
with(new menuname("fs1_popup")){
style=sectionMenuStyle;
alwaysvisible=0;
orientation="vertical";
aI("text=Summary;");
aI("text=Update;");
aI("text=Delete;");
}
with(new menuname("Primary")){
style=tstyle2;
alwaysvisible=1;
position="absolute";
aI("text=Customer: Harold Martinez;id=primary;image=images/icon_ep.gif;showmenu=CustomerPrimary;
offclass=treeBeginLoneItemCollapsed;
clickclass=treeBeginLoneItemExpanded;");
}
with(new menuname("CustomerPrimary")){
style=tstyle2;
aI("text=Commitment: 100001;showmenu=Commitment100001;clickfunction=popup('Commitment100001_pop', 1);image=images/icon_menu.gif;clickimage=images/icon_menu_open.gif;
offclass=treeItemCollapsed;clickclass=treeItemExpanded;");
aI("text=Commitment: 200023;showmenu=Commitment200023;image=images/icon_menu.gif;
clickimage=images/icon_menu_open.gif;offclass=treeItemCollapsed;
clickclass=treeItemExpanded;");
aI("text=Loan: 230043;showmenu=Loan230043;image=images/icon_menu.gif;
clickimage=images/icon_menu_open.gif;offclass=treeItemCollapsed;
clickclass=treeItemExpanded;");
aI("text=Commitment: 230053;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Financial Statement: Type 1;id=fs1;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Financial Statement: Type 2;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Financial Statement: Type 3;image=images/icon_item.gif;offclass=treeEndItem;");
}
with(new menuname("Commitment100001")){
style=tstyle1;
aI("text=Fee: Type 1;image=images/icon_item.gif;clickimage=images/icon_menu_open.gif;
offclass=treeItemBranch;");
aI("text=Fee: Type 2;image=images/icon_item.gif;clickimage=images/icon_menu_open.gif;
offclass=treeItemBranch;");
aI("text=Commitment: 343033;showmenu=Commitment343033;image=images/icon_menu.gif;
clickimage=images/icon_menu_open.gif;
offclass=treeItemCollapsed;clickclass=treeItemExpanded;");
}
with(new menuname("Commitment343033")){
style=tstyle1;
aI("text=Fee: Type 1;image=images/icon_item.gif;
clickimage=images/icon_menu_open.gif;offclass=treeItemBranch;");
aI("text=Fee: Type 4;image=images/icon_item.gif;
clickimage=images/icon_menu_open.gif;offclass=treeItemBranch;");
aI("text=Fee: Type 4;image=images/icon_item.gif;
clickimage=images/icon_menu_open.gif;offclass=treeItemBranch;");
aI("text=Fee: Type 4;image=images/icon_item.gif;
clickimage=images/icon_menu_open.gif;offclass=treeEndItem;");
}
with(new menuname("Commitment200023")){
style=tstyle1;
aI("text=Financial Statement: Type 1;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Creditor Report: Type 1;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Loan: 1230404;image=images/icon_item.gif;offclass=treeEndItem;");
}
with(new menuname("Commitment200023")){
style=tstyle1;
aI("text=Financial Statement: Type 1;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Creditor Report: Type 1;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Loan: 1230404;image=images/icon_item.gif;offclass=treeEndItem;");
}
with(new menuname("Loan230043")){
style=tstyle1;
aI("text=Financial Statement: Type 1;image=images/icon_item.gif;offclass=treeItemBranch;");
aI("text=Creditor Report: Type 1;image=images/icon_item.gif;offclass=treeEndItem;");
}
drawMenus();