Update SVG-Edit
This commit is contained in:
parent
a12a778c5a
commit
1bef71bbf1
9 changed files with 277 additions and 192 deletions
|
@ -36,13 +36,23 @@ var removedElements = {};
|
|||
* An interface that all command objects must implement.
|
||||
*
|
||||
* interface svgedit.history.HistoryCommand {
|
||||
* void apply();
|
||||
* void unapply();
|
||||
* void apply(svgedit.history.HistoryEventHandler);
|
||||
* void unapply(svgedit.history.HistoryEventHandler);
|
||||
* Element[] elements();
|
||||
* String getText();
|
||||
*
|
||||
* static String type();
|
||||
* }
|
||||
*
|
||||
* Interface: svgedit.history.HistoryEventHandler
|
||||
* An interface for objects that will handle history events.
|
||||
*
|
||||
* interface svgedit.history.HistoryEventHandler {
|
||||
* void handleHistoryEvent(eventType, command);
|
||||
* }
|
||||
*
|
||||
* eventType is a string conforming to one of the HistoryEvent types.
|
||||
* command is an object fulfilling the HistoryCommand interface.
|
||||
*/
|
||||
|
||||
// Class: svgedit.history.MoveElementCommand
|
||||
|
@ -213,8 +223,12 @@ svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) {
|
|||
}
|
||||
|
||||
svgedit.transformlist.removeElementFromListMap(this.elem);
|
||||
if(this.nextSibling == null) {
|
||||
console.log('Error: reference element was lost');
|
||||
}
|
||||
this.parent.insertBefore(this.elem, this.nextSibling);
|
||||
|
||||
|
||||
if (handler) {
|
||||
handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY, this);
|
||||
}
|
||||
|
@ -443,18 +457,6 @@ svgedit.history.BatchCommand.prototype.isEmpty = function() {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* Interface: svgedit.history.HistoryEventHandler
|
||||
* An interface for objects that will handle history events.
|
||||
*
|
||||
* interface svgedit.history.HistoryEventHandler {
|
||||
* void handleHistoryEvent(eventType, command);
|
||||
* }
|
||||
*
|
||||
* eventType is a string conforming to one of the HistoryEvent types (see above).
|
||||
* command is an object fulfilling the HistoryCommand interface (see above).
|
||||
*/
|
||||
|
||||
// Class: svgedit.history.UndoManager
|
||||
// Parameters:
|
||||
// historyEventHandler - an object that conforms to the HistoryEventHandler interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue