Iliyan Peychev![]()
YUI3 Undo Framework allows adding undo/redo functionality to an application.
It consists of two classes:
In addition to standard undo/redo functionality, YUI3 Undo Framework supports asynchronous actions too.
<script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2010.04.08-12-35'
}).use('gallery-undo', function(Y) {
var undoManager = new Y.UndoManager();
function MyAction(config){
MyAction.superclass.constructor.apply( this, arguments );
}
MyAction.NAME = "MyAction";
MyAction.ATTRS = {
...
};
Y.extend( MyAction, Y.UndoableAction, {
undo : function(){
...
},
redo : function() {
...
},
merge : function( newAction ) {
...
},
cancel : function() {
...
}
} );
Y.MyAction = MyAction;
var myAction = new Y.MyAction({
label: "My undoable action"
});
undoManager.add( myAction );
undoManager.undo();
undoManager.redo();
});No forum posts for this module.
© 2010 YUI Library - Site Credits