Commit 9bf87773 authored by Romain Loth's avatar Romain Loth

allow *not* rendering in cancelSelection

parent 0a553c8d
...@@ -71,7 +71,7 @@ function SelectionEngine() { ...@@ -71,7 +71,7 @@ function SelectionEngine() {
this.search_n_select = function(string) { this.search_n_select = function(string) {
// alert("search is happening !") // alert("search is happening !")
cancelSelection(false); cancelSelection(false, {norender:true});
if (typeof string != "string") { if (typeof string != "string") {
return -1 ; return -1 ;
...@@ -150,7 +150,8 @@ function SelectionEngine() { ...@@ -150,7 +150,8 @@ function SelectionEngine() {
*/ */
// ==================== // ====================
this.MultipleSelection2 = (function(nodes,nodesDict,edgesDict) { this.MultipleSelection2 = (function(nodes,nodesDict,edgesDict) {
// =====
var tMS2_deb = performance.now()
console.log("IN SelectionEngine.MultipleSelection2:") console.log("IN SelectionEngine.MultipleSelection2:")
console.log("nodes", nodes) console.log("nodes", nodes)
...@@ -315,6 +316,9 @@ function SelectionEngine() { ...@@ -315,6 +316,9 @@ function SelectionEngine() {
updateRelatedNodesPanel( selections , same, oppos ); updateRelatedNodesPanel( selections , same, oppos );
var tMS2_fin = performance.now()
console.log("end MultipleSelection2, own time:", tMS2_fin-tMS2_deb)
}).index() }).index()
}; };
...@@ -681,7 +685,7 @@ TinaWebJS = function ( sigmacanvas ) { ...@@ -681,7 +685,7 @@ TinaWebJS = function ( sigmacanvas ) {
// we keep the global selections and then clear it and all its effects // we keep the global selections and then clear it and all its effects
var previousSelection = selections var previousSelection = selections
cancelSelection(false); cancelSelection(false, {norender:true}); // no need to render before MS2
if (cursor_size == 0) { if (cursor_size == 0) {
var targeted = SelInst.SelectorEngine( { var targeted = SelInst.SelectorEngine( {
......
'use strict'; 'use strict';
function cancelSelection (fromTagCloud) {
// settings: {norender: Bool}
function cancelSelection (fromTagCloud, settings) {
console.log("\t***in cancelSelection"); console.log("\t***in cancelSelection");
if (!settings) settings = {}
highlightSelectedNodes(false); //Unselect the selected ones :D highlightSelectedNodes(false); //Unselect the selected ones :D
opossites = []; opossites = [];
selections = []; selections = [];
...@@ -72,8 +76,10 @@ function cancelSelection (fromTagCloud) { ...@@ -72,8 +76,10 @@ function cancelSelection (fromTagCloud) {
// global flag // global flag
TW.selectionActive = false TW.selectionActive = false
// finally redraw if (!settings.norender) {
TW.partialGraph.render(); // finally redraw
TW.partialGraph.render();
}
} }
function highlightSelectedNodes(flag){ function highlightSelectedNodes(flag){
......
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