mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-04 14:56:16 +00:00
Add global undo for graph
This commit is contained in:
@@ -240,6 +240,8 @@ function postLoadPage()
|
||||
var key = getChar(event);
|
||||
var code = getCharCode(event);
|
||||
console.log(key + " code=" + code);
|
||||
var evtobj = window.event ? event : e;
|
||||
var isCtrl = evtobj ? evtobj.ctrlKey : false;
|
||||
|
||||
var moveValue = 10;
|
||||
if (code == 61 || code == 43) // +
|
||||
@@ -289,6 +291,11 @@ function postLoadPage()
|
||||
{
|
||||
selectHandler('Default', 'default');
|
||||
}
|
||||
else if (code == 26 && isCtrl)
|
||||
{
|
||||
userAction("Key_GraphUndo");
|
||||
application.SetHandlerMode("graphUndo");
|
||||
}
|
||||
}
|
||||
|
||||
$(document).keydown(function(event) {
|
||||
@@ -463,6 +470,12 @@ function postLoadPage()
|
||||
userAction(this.id);
|
||||
application.SetHandlerMode("setupBackgroundStyle");
|
||||
}
|
||||
|
||||
document.getElementById('GraphUndo').onclick = function ()
|
||||
{
|
||||
userAction(this.id);
|
||||
application.SetHandlerMode("graphUndo");
|
||||
}
|
||||
|
||||
document.getElementById('runUserScript').onclick = function ()
|
||||
{
|
||||
@@ -652,8 +665,6 @@ function postLoadPage()
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
var devTools = document.getElementById('developerTools');
|
||||
devTools.style.left = 0;
|
||||
resizeCanvas();
|
||||
|
||||
Reference in New Issue
Block a user