Commit 1a7fd814 authored by Romain Loth's avatar Romain Loth

SHIFT key activates checkBox

cf. github.com/ISCPIF/gargantext/commit/2e4037c
parent 01491368
......@@ -166,6 +166,7 @@ var gexf;
//var zoom=0;
var checkBox=false;
var manuallyChecked = false;
var overNodes=false;
var shift_key=false;
......
......@@ -883,6 +883,15 @@ TinaWebJS = function ( sigmacanvas ) {
}
});
// general listener: shift key in the window <=> add to selection
$(document).on('keyup keydown', function(e){
// changes the global boolean ("add node to selection" status) if keydown and SHIFT
checkBox = manuallyChecked || e.shiftKey
// show it in the real checkbox too
$('#checkboxdiv').prop("checked", manuallyChecked || e.shiftKey)
} );
// costly entire refresh (~400ms) only after stopped resizing for 3s
// NB: rescale middleware already reacted and, except for large win size changes, it handles the resize fine
// (so this fragment is only to accomodate the large changes)
......
......@@ -92,7 +92,13 @@ function highlightSelectedNodes(flag){
}
function alertCheckBox(eventCheck){
if(!isUndef(eventCheck.checked)) checkBox=eventCheck.checked;
// NB: we use 2 booleans to adapt to SHIFT checking
// - var checkBox ---------> has the real box state
// - var manuallyChecked --> remembers if it was changed here
if(!isUndef(eventCheck.checked)) {
checkBox=eventCheck.checked;
manuallyChecked = eventCheck.checked
}
}
// States:
......
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