Commit d3fcaa96 authored by Romain Loth's avatar Romain Loth

Multiple nodes selection: hide unselect button when nothing selected

parent d1d9a400
...@@ -312,16 +312,16 @@ ...@@ -312,16 +312,16 @@
<!-- Sidebar right, old css --> <!-- Sidebar right, old css -->
<div id="rightcolumn"> <div id="rightcolumn">
<button
style="color: #900;font-weight: bold;font-size: 70%;text-transform: uppercase;float:right;"
onClick='cancelSelection(false);'
>X</button>
<!-- TODO: put the video on cloud for better streaming & player --> <!-- TODO: put the video on cloud for better streaming & player -->
<video width="100%" <video width="100%"
id="video_explanation" id="video_explanation"
src="video/AXA2015.mp4" controls="" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></video> src="video/AXA2015.mp4" controls="" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></video>
<button id="unselectbutton"
style="color: #900;font-weight: bold;font-size: 70%;text-transform: uppercase;float:right;"
onClick='cancelSelection(false);'
>X</button>
<div id="tips"></div> <div id="tips"></div>
<div id="names"></div> <div id="names"></div>
......
...@@ -47,8 +47,9 @@ function sigmaLimits( sigmacanvas ) { ...@@ -47,8 +47,9 @@ function sigmaLimits( sigmacanvas ) {
} }
// will be instanciated as SelInst
SelectionEngine = function() { SelectionEngine = function() {
// Selection Engine!! finally... // Selection Engine!! finally...
this.SelectorEngine_part01 = (function(cursorsize, area ) { this.SelectorEngine_part01 = (function(cursorsize, area ) {
var clickedNodes = [] var clickedNodes = []
...@@ -61,6 +62,7 @@ SelectionEngine = function() { ...@@ -61,6 +62,7 @@ SelectionEngine = function() {
return n.id; return n.id;
}); });
} }
return clickedNodes.map(Number); return clickedNodes.map(Number);
}).index(); }).index();
...@@ -261,14 +263,17 @@ SelectionEngine = function() { ...@@ -261,14 +263,17 @@ SelectionEngine = function() {
}); });
return actualSel; return actualSel;
} }
/**
* Main function for any selecting action
*/
// external usage : partialGraph , updateLeftPanel_fix(); // external usage : partialGraph , updateLeftPanel_fix();
this.MultipleSelection2 = (function(nodes,nodesDict,edgesDict) { this.MultipleSelection2 = (function(nodes,nodesDict,edgesDict) {
console.log("IN SelectionEngine.MultipleSelection2:") console.log("IN SelectionEngine.MultipleSelection2:")
console.log(nodes) console.log(nodes)
greyEverything(); greyEverything();
var typeNow = TW.partialGraph.states.slice(-1)[0].type.map(Number).join("|") var typeNow = TW.partialGraph.states.slice(-1)[0].type.map(Number).join("|")
console.log ("console.loging the Type:") console.log ("console.loging the Type:")
...@@ -326,6 +331,8 @@ SelectionEngine = function() { ...@@ -326,6 +331,8 @@ SelectionEngine = function() {
} }
} }
// show the button to remove selection
$("#unselectbutton").show() ;
var the_new_sels = Object.keys(selections).map(Number) var the_new_sels = Object.keys(selections).map(Number)
TW.partialGraph.states.slice(-1)[0].selections = the_new_sels; TW.partialGraph.states.slice(-1)[0].selections = the_new_sels;
...@@ -380,7 +387,7 @@ TinaWebJS = function ( sigmacanvas ) { ...@@ -380,7 +387,7 @@ TinaWebJS = function ( sigmacanvas ) {
} }
this.SearchListeners = function () { this.SearchListeners = function () {
var SelInst = new SelectionEngine(); var SelInst = new SelectionEngine();
//~ $.ui.autocomplete.prototype._renderItem = function(ul, item) { //~ $.ui.autocomplete.prototype._renderItem = function(ul, item) {
......
...@@ -11,7 +11,6 @@ function cancelSelection (fromTagCloud) { ...@@ -11,7 +11,6 @@ function cancelSelection (fromTagCloud) {
TW.partialGraph.states.slice(-1)[0].selections=[] TW.partialGraph.states.slice(-1)[0].selections=[]
//Nodes colors go back to normal //Nodes colors go back to normal
overNodes=false; overNodes=false;
e = TW.partialGraph._core.graph.edges; e = TW.partialGraph._core.graph.edges;
...@@ -29,13 +28,14 @@ function cancelSelection (fromTagCloud) { ...@@ -29,13 +28,14 @@ function cancelSelection (fromTagCloud) {
//Nodes colors go back to normal //Nodes colors go back to normal
if(fromTagCloud==false){ if(fromTagCloud==false){
$("#names").html(""); $("#names").html("");
$("#topPapers").html(""); $("#topPapers").hide(); $("#topPapers").html(""); $("#topPapers").hide();
$("#opossiteNodes").html(""); $("#tab-container").hide(); $("#opossiteNodes").html(""); $("#tab-container").hide();
$("#information").html(""); $("#information").html("");
$("#searchinput").val(""); $("#searchinput").val("");
$("#switchbutton").hide(); $("#unselectbutton").hide();
$("#tips").html(getTips()); $("#tips").html(getTips());
} }
for(var i in deselections){ for(var i in deselections){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment