mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 10:40:57 +00:00
Change script location.
Split js code. Added cache and changed loading mechanism for js sources.
This commit is contained in:
52
script/features/delete_objects_handler/index.js
Normal file
52
script/features/delete_objects_handler/index.js
Normal file
@@ -0,0 +1,52 @@
|
||||
doInclude ([
|
||||
include ("features/base_handler/index.js")
|
||||
])
|
||||
|
||||
/**
|
||||
* Delete Graph handler.
|
||||
*
|
||||
*/
|
||||
function DeleteGraphHandler(app)
|
||||
{
|
||||
this.removeStack = true;
|
||||
BaseHandler.apply(this, arguments);
|
||||
this.message = g_selectObjectToDelete;
|
||||
this.addContextMenu();
|
||||
}
|
||||
|
||||
// inheritance.
|
||||
DeleteGraphHandler.prototype = Object.create(BaseHandler.prototype);
|
||||
|
||||
DeleteGraphHandler.prototype.MouseDown = function(pos)
|
||||
{
|
||||
var selectedObject = this.GetSelectedObject(pos);
|
||||
|
||||
if (!this.app.IsCorrectObject(selectedObject))
|
||||
return;
|
||||
|
||||
this.app.PushToStack("Delete");
|
||||
this.app.DeleteObject(selectedObject);
|
||||
this.needRedraw = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Graph handler.
|
||||
*
|
||||
*/
|
||||
function DeleteAllHandler(app)
|
||||
{
|
||||
BaseHandler.apply(this, arguments);
|
||||
}
|
||||
|
||||
// inheritance.
|
||||
DeleteAllHandler.prototype = Object.create(BaseHandler.prototype);
|
||||
|
||||
DeleteAllHandler.prototype.clear = function()
|
||||
{
|
||||
this.app.PushToStack("DeleteAll");
|
||||
|
||||
// Selected Graph.
|
||||
this.app.graph = new Graph();
|
||||
this.app.savedGraphName = "";
|
||||
this.needRedraw = true;
|
||||
}
|
||||
Reference in New Issue
Block a user