If a valid/restorable fragment is available in a transaction metadata it
gets passed to the callback where client code can handle selection restore.
icon: 'share-alt',
iconStyle: dir === 'undo' ? '-webkit-transform: scale(-1,1); transform: scale(-1, 1)' : '',
execute: function(callback, params) {
icon: 'share-alt',
iconStyle: dir === 'undo' ? '-webkit-transform: scale(-1,1); transform: scale(-1, 1)' : '',
execute: function(callback, params) {
+ var metadata = _.last(params.document[dir+'Stack']).metadata,
+ fragment = metadata && metadata.fragment;
+ if(fragment) {
+ if(!fragment.isValid()) {
+ fragment.restoreFromPaths();
+ }
+ if(fragment.isValid()) {
+ callback(fragment);
+ }
+ }