diff --git a/README.md b/README.md index 588b6f73..c5a64c20 100644 --- a/README.md +++ b/README.md @@ -78,14 +78,6 @@ WSGIScriptAlias / /path_to_GraphSpace/graphspace/wsgi.py Refer to https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/ if any problems occur with the setup. -Testing the GraphSpace REST API -================================= - -1. Follow the instructions above to run GraphSpace locally or on Apache2. -2. Navigate to the tests directory in GraphSpace: `cd tests` -2. Enter python command to run test cases: `python restapi_test.py` - -This script will test all the REST API commands supported by the GraphSpace server. If something fails, it will display the error. Contributing ================= diff --git a/static/js/graphs_page.js b/static/js/graphs_page.js index 02da7544..559ecbf8 100644 --- a/static/js/graphs_page.js +++ b/static/js/graphs_page.js @@ -430,6 +430,16 @@ var graphPage = { utils.initializeTabs(); + $('#saveOnExitLayoutBtn').click(function () { + graphPage.cyGraph.contextMenus('get').destroy(); // Destroys the cytocscape context menu extension instance. + + cytoscapeGraph.showGraphInformation(graphPage.cyGraph); + // display node data as a popup + graphPage.cyGraph.unbind('tap').on('tap', graphPage.onTapGraphElement); + + graphPage.saveLayout($('#saveOnExitLayoutNameInput').val(), '#saveOnExitLayoutModal'); + }); + $('#saveLayoutBtn').click(function () { graphPage.cyGraph.contextMenus('get').destroy(); // Destroys the cytocscape context menu extension instance. @@ -437,7 +447,7 @@ var graphPage = { // display node data as a popup graphPage.cyGraph.unbind('tap').on('tap', graphPage.onTapGraphElement); - graphPage.saveLayout($('#layoutNameInput').val()); + graphPage.saveLayout($('#saveLayoutNameInput').val(), '#saveLayoutModal'); }); $('#layoutEditorBtn').click(function () { @@ -445,6 +455,11 @@ var graphPage = { }); $('#exitLayoutEditorBtn').click(function () { + $('#exitLayoutBtn').removeClass('hidden'); + $('#saveOnExitLayoutModal').modal('show'); + }); + + $('#saveLayoutEditorBtn').click(function () { $('#exitLayoutBtn').removeClass('hidden'); $('#saveLayoutModal').modal('show'); }); @@ -457,11 +472,6 @@ var graphPage = { graphPage.cyGraph.unbind('tap').on('tap', graphPage.onTapGraphElement); }); - $('#saveLayoutModalBtn').click(function () { - $('#exitLayoutBtn').addClass('hidden'); - $('#saveLayoutModal').modal('show'); - }); - $('#ConfirmRemoveLayoutBtn').click(graphPage.layoutsTable.onConfirmRemoveGraph); $('#ConfirmUpdateLayoutBtn').click(graphPage.layoutsTable.onConfirmUpdateGraph); @@ -584,7 +594,7 @@ var graphPage = { graphPage.cyGraph.layout(layout); }, - saveLayout: function (layoutName) { + saveLayout: function (layoutName, modalNameId) { graphPage.cyGraph.elements().unselect(); if (_.trim(layoutName).length === 0) { @@ -636,7 +646,7 @@ var graphPage = { } }, successCallback = function (response) { - $('#saveLayoutModal').modal('toggle'); + $(modalNameId).modal('toggle'); $('#PrivateLayoutsTable').bootstrapTable('refresh'); $('#SharedLayoutsTable').bootstrapTable('refresh'); }, diff --git a/templates/graph/index.html b/templates/graph/index.html index 8eb07ba2..bea8db4b 100644 --- a/templates/graph/index.html +++ b/templates/graph/index.html @@ -75,9 +75,9 @@ - - -