Commit 93d0c79e authored by Romain Loth's avatar Romain Loth

CTRL+Z working for selections

parent 0cfe2f7d
......@@ -789,6 +789,40 @@ var TinaWebJS = function ( sigmacanvas ) {
// show it in the real TW.gui.checkBox too
$('#checkboxdiv').prop("checked", TW.gui.manuallyChecked || e.shiftKey)
// also listen for CTRL+Z 17 + 90
if (e.type == "keyup"
&& (e.which == 90 || e.keyCode == 90) && e.ctrlKey
&& TW.states.length > 2
) {
if (timeoutIdCTRLZ) {
window.clearTimeout(timeoutIdCTRLZ)
}
var timeoutIdCTRLZ = window.setTimeout(function() {
if (TW.gui.selectionActive) {
deselectNodes(TW.SystemState())
TW.gui.selectionActive = false
}
console.log("pop state")
TW.states.pop()
let returningState = TW.SystemState()
if (returningState.selectionNids.length) {
TW.instance.selNgn.MultipleSelection2({nodes:returningState.selectionNids})
}
else {
cancelSelection()
}
TW.partialGraph.refresh()
}, 100)
}
} );
} // finish envListeners
......
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