- changeType: function(params) {
- params.fragment.node.getParent('list').setClass(type === 'Bullet' ? 'list' : 'list.enum');
+ changeType: function(callback, params) {
+ var node = params.fragment.node,
+ action = this;
+ node.document.transaction(function() {
+ var list = node.getParent('list');
+ list.setClass(type === 'Bullet' ? 'list' : 'list.enum');
+ if(params.fragment.isValid()) {
+ return params.fragment;
+ } else {
+ return node.document.createFragment(node.document.NodeFragment, {node: list.contents()[0]});
+ }
+ }, {
+ metadata: {
+ description: action.getState().description,
+ fragment: params.fragment
+ },
+ success: callback
+ });