Skip to content

Commit

Permalink
fixed js
Browse files Browse the repository at this point in the history
  • Loading branch information
anvasi committed Oct 5, 2018
1 parent bc21bb8 commit 2fb4e45
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/main/resources/org/combinators/cls/ide/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ require(['bootstrap', 'cytoscape'], function(bootstrap, cytoscape) {
$('.nav-sidebar a[href="#results"]').on('shown.bs.tab', function(){

$.get("countSolutions", function(number){
console.log("Number", number);
for (var item = 0; item < number ; item ++) {
var nav = document.createElement("nav");
nav.className = "navbar navbar-default"
Expand Down Expand Up @@ -96,9 +95,8 @@ require(['bootstrap', 'cytoscape'], function(bootstrap, cytoscape) {
var solution = document.createElement("solution");
divSol.appendChild(solution);
solution.appendChild(text);
console.log("Index", $.get("showResult/" + parseInt(e.target.id)))
$.get("showResult/" + parseInt(e.target.id), function(data){
showPartGraph(parseInt(e.target.id));
showPartGraph(parseInt(e.target.id));
var text = document.createTextNode(data);
divSol.appendChild(solution);
solution.appendChild(text);
Expand Down Expand Up @@ -165,13 +163,13 @@ require(['bootstrap', 'cytoscape'], function(bootstrap, cytoscape) {
function showPartGraph(index){
$.get("showOnePossibleSolutionGraph/" + index, function(data){
try {
var graph = JSON.parse(data);
mkGraph(graph, "#cy-part-graph");
}
catch{
$("#cy--part-graph").html(data.replace(/\n/g, '<br />'));
}
});
var graph = JSON.parse(data);
mkGraph(graph, "#cy-part-graph");
}
catch{
$("#cy--part-graph").html(data.replace(/\n/g, '<br />'));
}
});
}

function toggleCycle(stepNr){
Expand Down Expand Up @@ -369,7 +367,6 @@ require(['bootstrap', 'cytoscape'], function(bootstrap, cytoscape) {
fit: false,
padding: 75,
avoidOverlapPadding: 75,
// ready: function() { console.log("resized"); }
}).run();}

cy.layout({
Expand All @@ -379,7 +376,6 @@ require(['bootstrap', 'cytoscape'], function(bootstrap, cytoscape) {
animate: true,
avoidOverlap: true,
avoidOverlapPadding: 75,
// ready: function() {console.log("bf resized")
}).run()
}

Expand Down

0 comments on commit 2fb4e45

Please sign in to comment.