Mercurial > hg > Members > nobuyasu > html > graphViewer
changeset 41:d75a3fdcbfdd draft
modified selectMenu
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Mar 2013 19:01:44 +0900 |
parents | 8c3c1059e526 |
children | 238cc49e07ef |
files | show.html |
diffstat | 1 files changed, 18 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/show.html Sat Mar 23 18:26:33 2013 +0900 +++ b/show.html Sat Mar 23 19:01:44 2013 +0900 @@ -588,14 +588,29 @@ appendMenuBody(menu, div); bindObj.bindings[idName] = returnTraverseMenuFunction(edgeInfo.kind); } - console.log("bindObj = ",bindObj); return bindObj; } function setInitContextMenu(node,elem) { var tObj = createTraverseMenuAndObj(node.property.edgeInfo); var bindObj = createContextMenuObj(node, tObj); - elem.contextMenu('selectMenu', bindObj); + elem.bindObj = bindObj; + elem.menuHTML = $('#selectMenu').clone()[0].innerHTML; +} + +function updateContextMenu(elem) { + removeContextMenu(); + if (!elem.bindObj) return; + var menu = $('#selectMenu'); + console.log("elem.bindObj"); + console.log("menu : ",menu); + menu[0].innerHTML = elem.menuHTML; + elem.contextMenu('selectMenu', elem.bindObj); +} + +function removeContextMenu() { + $('#stateSelectMenu').children().remove(); + $('#traverseSelectMenu').children().remove(); } function updateNodeElement(node) { @@ -607,7 +622,7 @@ var div = node.view; setInitContextMenu(node,div); div.hover( - function(){div.css("box-shadow","white 0 0 50px"); }, + function(){div.css("box-shadow","white 0 0 50px"); console.log('hover'); updateContextMenu(div); }, function(){div.css("box-shadow","");} ); node.view[0].nodeId = node.property.id;