1
0
Fork 0

Fixed the graphviewer to new header bar layout

This commit is contained in:
Michael Hackstein 2014-01-27 09:17:53 +01:00
parent cd40fe8328
commit a214f057e1
1 changed files with 21 additions and 71 deletions

View File

@ -208,36 +208,38 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
makeConfigure = function (div, idConf, idFilter) { makeConfigure = function (div, idConf, idFilter) {
var ul, liConf, aConf, spanConf, liFilter, aFilter, spanFilter, lists; var ul, liConf, aConf, spanConf, liFilter, aFilter, spanFilter, lists;
div.className = "pagination pagination-small pagination-right btn-group"; div.className = "headerButtonBar pull-right";
ul = document.createElement("ul"); ul = document.createElement("ul");
liConf = document.createElement("li"); ul.className = "headerButtonList";
liConf.className = "enabled";
aConf = document.createElement("a"); div.appendChild(ul);
aConf.id = idConf;
aConf.className = "arangoHeaderA";
spanConf = document.createElement("span");
spanConf.className = "glyphicon glyphicon-cog";
$(spanConf).attr("data-original-title", "Configure");
liFilter = document.createElement("li"); liFilter = document.createElement("li");
liFilter.className = "enabled"; liFilter.className = "enabled";
aFilter = document.createElement("a"); aFilter = document.createElement("a");
aFilter.id = idFilter; aFilter.id = idFilter;
aFilter.className = "arangoHeaderA"; aFilter.className = "headerButton";
spanFilter = document.createElement("span"); spanFilter = document.createElement("span");
spanFilter.className = "glyphicon glyphicon-filter"; spanFilter.className = "icon_arangodb_filter";
$(spanFilter).attr("data-original-title", "Filter"); $(spanFilter).attr("title", "Filter");
div.appendChild(ul); ul.appendChild(liFilter);
liFilter.appendChild(aFilter);
aFilter.appendChild(spanFilter);
liConf = document.createElement("li");
liConf.className = "enabled";
aConf = document.createElement("a");
aConf.id = idConf;
aConf.className = "headerButton";
spanConf = document.createElement("span");
spanConf.className = "icon_arangodb_settings2";
$(spanConf).attr("title", "Configure");
ul.appendChild(liConf); ul.appendChild(liConf);
liConf.appendChild(aConf); liConf.appendChild(aConf);
aConf.appendChild(spanConf); aConf.appendChild(spanConf);
ul.appendChild(liFilter);
liFilter.appendChild(aFilter);
aFilter.appendChild(spanFilter);
lists = makeConfigureDiv(); lists = makeConfigureDiv();
lists.filter = makeFilterDiv(); lists.filter = makeFilterDiv();
aConf.onclick = function () { aConf.onclick = function () {
@ -363,58 +365,12 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
createMenu = function() { createMenu = function() {
var transparentHeader = document.createElement("div"), var transparentHeader = document.createElement("div"),
buttons = document.createElement("div"), buttons = document.createElement("div"),
configureDropDown = document.createElement("div"),
configureLists = makeConfigure( configureLists = makeConfigure(
configureDropDown, buttons,
"configuredropdown", "configuredropdown",
"filterdropdown" "filterdropdown"
); );
/*
nodeShaperDropDown = document.createElement("div"),
nodeShaperList = makeBootstrapDropdown(
nodeShaperDropDown,
"nodeshaperdropdown",
"Nodes"
),
edgeShaperDropDown = document.createElement("div"),
edgeShaperList = makeBootstrapDropdown(
edgeShaperDropDown,
"edgeshaperdropdown",
"Edges"
),
adapterDropDown = document.createElement("div"),
adapterList = makeBootstrapDropdown(
adapterDropDown,
"adapterdropdown",
"Connection"
),
layouterDropDown = document.createElement("div"),
layouterList = makeBootstrapDropdown(
layouterDropDown,
"layouterdropdown",
"Layout"
),
nodeShaperUI = new NodeShaperControls(
nodeShaperList,
graphViewer.nodeShaper
),
edgeShaperUI = new EdgeShaperControls(
edgeShaperList,
graphViewer.edgeShaper
),
layouterUI = new LayouterControls(
layouterList,
graphViewer.layouter
),
adapterUI = new ArangoAdapterControls(
adapterList,
graphViewer.adapter
),
*/
nodeShaperUI = new NodeShaperControls( nodeShaperUI = new NodeShaperControls(
configureLists.nodes, configureLists.nodes,
graphViewer.nodeShaper graphViewer.nodeShaper
@ -427,11 +383,9 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
menubar.id = "menubar"; menubar.id = "menubar";
menubar.className = "thumbnails2"; menubar.className = "thumbnails2";
transparentHeader.id = "transparentHeader"; transparentHeader.className = "headerBar"
buttons.id = "modifiers"; buttons.id = "modifiers";
buttons.className = "pull-right";
/* /*
nodeShaperDropDown.id = "nodeshapermenu"; nodeShaperDropDown.id = "nodeshapermenu";
@ -439,16 +393,12 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
layouterDropDown.id = "layoutermenu"; layouterDropDown.id = "layoutermenu";
adapterDropDown.id = "adaptermenu"; adapterDropDown.id = "adaptermenu";
*/ */
configureDropDown.id = "configuremenu";
menubar.appendChild(transparentHeader); menubar.appendChild(transparentHeader);
menubar.appendChild(configureLists.configure); menubar.appendChild(configureLists.configure);
menubar.appendChild(configureLists.filter); menubar.appendChild(configureLists.filter);
transparentHeader.appendChild(buttons); transparentHeader.appendChild(buttons);
buttons.appendChild(configureDropDown);
adapterUI.addControlChangeCollections(function() { adapterUI.addControlChangeCollections(function() {
updateAttributeExamples(); updateAttributeExamples();
graphViewer.start(); graphViewer.start();