forward porting assetmanager crumb trail more menu
This commit is contained in:
parent
c066b2bf18
commit
3cf6d283da
3 changed files with 68 additions and 19 deletions
|
|
@ -41,6 +41,33 @@ WebGUI.AssetManager.addHighlightToRow
|
|||
}
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetManager.buildMoreMenu ( url, linkElement )
|
||||
Build a WebGUI style "More" menu for the asset referred to by url
|
||||
*/
|
||||
WebGUI.AssetManager.buildMoreMenu
|
||||
= function ( url, linkElement ) {
|
||||
// Build a more menu
|
||||
var rawItems = WebGUI.AssetManager.MoreMenuItems;
|
||||
var menuItems = [];
|
||||
for ( var i = 0; i < rawItems.length; i++ ) {
|
||||
var itemUrl = rawItems[i].url.match( /<url>/ )
|
||||
? rawItems[i].url.replace( /<url>(?:\?(.*))?/, WebGUI.AssetManager.appendToUrl(url, "$1") )
|
||||
: url + rawItems[i].url
|
||||
;
|
||||
menuItems.push( { "url" : itemUrl, "text" : rawItems[i].label } );
|
||||
}
|
||||
var options = {
|
||||
"zindex" : 1000,
|
||||
"clicktohide" : true,
|
||||
"position" : "dynamic",
|
||||
"context" : [ linkElement, "tl", "bl" ],
|
||||
"itemdata" : menuItems
|
||||
};
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetManager.findRow ( child )
|
||||
Find the row that contains this child element.
|
||||
|
|
@ -82,24 +109,7 @@ WebGUI.AssetManager.formatActions = function ( elCell, oRecord, oColumn, orderNu
|
|||
oldMenu.parentNode.removeChild( oldMenu );
|
||||
}
|
||||
|
||||
// Build a more menu
|
||||
var rawItems = WebGUI.AssetManager.MoreMenuItems;
|
||||
var menuItems = [];
|
||||
for ( var i = 0; i < rawItems.length; i++ ) {
|
||||
var itemUrl = rawItems[i].url.match( /<url>/ )
|
||||
? rawItems[i].url.replace( /<url>(?:\?(.*))?/, WebGUI.AssetManager.appendToUrl(oRecord.getData( 'url' ), "$1") )
|
||||
: oRecord.getData( 'url' ) + rawItems[i].url
|
||||
;
|
||||
menuItems.push( { "url" : itemUrl, "text" : rawItems[i].label } );
|
||||
}
|
||||
|
||||
var options = {
|
||||
"zindex" : 1000,
|
||||
"clicktohide" : true,
|
||||
"position" : "dynamic",
|
||||
"context" : [ more, "tl", "bl" ],
|
||||
"itemdata" : menuItems
|
||||
};
|
||||
var options = WebGUI.AssetManager.buildMoreMenu(oRecord.getData( 'url' ), more);
|
||||
|
||||
var menu = new YAHOO.widget.Menu( "moreMenu" + oRecord.getData( 'assetId' ), options );
|
||||
YAHOO.util.Event.onDOMReady( function () { menu.render( document.getElementById( 'assetManager' ) ) } );
|
||||
|
|
@ -329,6 +339,24 @@ WebGUI.AssetManager.selectRow = function ( child ) {
|
|||
}
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetManager.showMoreMenu ( url, linkTextId )
|
||||
Build a More menu for the last element of the Crumb trail
|
||||
*/
|
||||
WebGUI.AssetManager.showMoreMenu
|
||||
= function ( url, linkTextId ) {
|
||||
var more = document.getElementById(linkTextId);
|
||||
|
||||
var options = WebGUI.AssetManager.buildMoreMenu(url, more);
|
||||
|
||||
var menu = new YAHOO.widget.Menu( "crumbMoreMenu", options );
|
||||
menu.render( document.getElementById( 'assetManager' ) );
|
||||
menu.show();
|
||||
menu.focus();
|
||||
//YAHOO.util.Event.onDOMReady( function () { menu.render( document.getElementById( 'assetManager' ) ) } );
|
||||
//YAHOO.util.Event.addListener( more, "click", function (e) { menu.show(); menu.focus(); YAHOO.util.Event.stopEvent(e); }, null, menu );
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetManager.toggleHighlightForRow ( checkbox )
|
||||
Toggle the highlight for the row based on the state of the checkbox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue