add paste action to clipboard items

This commit is contained in:
Doug Bell 2010-07-15 15:37:56 -05:00
parent fb32813bd9
commit 68bde02f28

View file

@ -251,9 +251,32 @@ WebGUI.Admin.prototype.updateClipboard
a.appendChild( icon );
a.appendChild( document.createTextNode( asset.title ) );
div.appendChild( a );
this.addPasteHandler( a, asset.assetId );
}
};
/**
* addPasteHandler( elem, assetId )
* Add an onclick handler to paste an asset.
*/
WebGUI.Admin.prototype.addPasteHandler
= function ( elem, assetId ) {
var self = this;
YAHOO.util.Event.on( elem, "click", function(){
self.pasteAsset( assetId );
}, self );
};
/**
* pasteAsset( id )
* Paste an asset and update the clipboard
*/
WebGUI.Admin.prototype.pasteAsset
= function ( id ) {
var url = appendToUrl( this.currentAssetDef.url, 'func=paste;assetId=' + id );
this.gotoAsset( url );
};
/****************************************************************************
* WebGUI.Admin.LocationBar
*/