Actions are now Helpers. remove old code
This commit is contained in:
parent
03d3e8ab8e
commit
18bb5a1ae5
1 changed files with 5 additions and 45 deletions
|
|
@ -1023,8 +1023,6 @@ WebGUI.Admin.Tree
|
||||||
var selectAllSpan = document.createElement( 'span' );
|
var selectAllSpan = document.createElement( 'span' );
|
||||||
selectAllSpan.appendChild( selectAllCheck );
|
selectAllSpan.appendChild( selectAllCheck );
|
||||||
|
|
||||||
this.moreMenusDisplayed = {};
|
|
||||||
this.crumbMoreMenu = null;
|
|
||||||
this.defaultSortBy = {
|
this.defaultSortBy = {
|
||||||
"key" : "lineage",
|
"key" : "lineage",
|
||||||
"dir" : YAHOO.widget.DataTable.CLASS_ASC
|
"dir" : YAHOO.widget.DataTable.CLASS_ASC
|
||||||
|
|
@ -1051,6 +1049,7 @@ WebGUI.Admin.Tree
|
||||||
{ key: 'assetId' },
|
{ key: 'assetId' },
|
||||||
{ key: 'lineage' },
|
{ key: 'lineage' },
|
||||||
{ key: 'canEdit' },
|
{ key: 'canEdit' },
|
||||||
|
{ key: 'helpers' },
|
||||||
{ key: 'title' },
|
{ key: 'title' },
|
||||||
{ key: 'className' },
|
{ key: 'className' },
|
||||||
{ key: 'revisionDate' },
|
{ key: 'revisionDate' },
|
||||||
|
|
@ -1071,7 +1070,7 @@ WebGUI.Admin.Tree
|
||||||
= [
|
= [
|
||||||
{ key: 'assetId', label: selectAllSpan.innerHTML, formatter: this.formatAssetIdCheckbox },
|
{ key: 'assetId', label: selectAllSpan.innerHTML, formatter: this.formatAssetIdCheckbox },
|
||||||
{ key: 'lineage', label: window.admin.i18n.get('Asset','rank'), sortable: true, formatter: this.formatRank },
|
{ key: 'lineage', label: window.admin.i18n.get('Asset','rank'), sortable: true, formatter: this.formatRank },
|
||||||
{ key: 'actions', label: "", formatter: this.formatActions },
|
{ key: 'helpers', label: "", formatter: this.formatHelpers },
|
||||||
{ key: 'title', label: window.admin.i18n.get('Asset', '99'), formatter: this.formatTitle, sortable: true },
|
{ key: 'title', label: window.admin.i18n.get('Asset', '99'), formatter: this.formatTitle, sortable: true },
|
||||||
{ key: 'className', label: window.admin.i18n.get('Asset','type'), sortable: true, formatter: this.formatClassName },
|
{ key: 'className', label: window.admin.i18n.get('Asset','type'), sortable: true, formatter: this.formatClassName },
|
||||||
{ key: 'revisionDate', label: window.admin.i18n.get('Asset','revision date' ), formatter: this.formatRevisionDate, sortable: true },
|
{ key: 'revisionDate', label: window.admin.i18n.get('Asset','revision date' ), formatter: this.formatRevisionDate, sortable: true },
|
||||||
|
|
@ -1116,35 +1115,6 @@ WebGUI.Admin.Tree.prototype.addHighlightToRow
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* buildMoreMenu ( url, linkElement )
|
|
||||||
* Build a WebGUI style "More" menu for the asset referred to by url
|
|
||||||
*/
|
|
||||||
WebGUI.Admin.Tree.prototype.buildMoreMenu
|
|
||||||
= function ( url, linkElement, isNotLocked ) {
|
|
||||||
var rawItems = this.moreMenuItems;
|
|
||||||
var menuItems = [];
|
|
||||||
var isLocked = !isNotLocked;
|
|
||||||
for ( var i = 0; i < rawItems.length; i++ ) {
|
|
||||||
var itemUrl = rawItems[i].url
|
|
||||||
? appendToUrl(url, rawItems[i].url)
|
|
||||||
: url
|
|
||||||
;
|
|
||||||
if (! (itemUrl.match( /func=edit;/) && isLocked )) {
|
|
||||||
menuItems.push( { "url" : itemUrl, "text" : rawItems[i].label } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var options = {
|
|
||||||
"zindex" : 1000,
|
|
||||||
"clicktohide" : true,
|
|
||||||
"position" : "dynamic",
|
|
||||||
"context" : [ linkElement, "tl", "bl", ["beforeShow", "windowResize"] ],
|
|
||||||
"itemdata" : menuItems
|
|
||||||
};
|
|
||||||
|
|
||||||
return options;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* buildQueryString ( )
|
* buildQueryString ( )
|
||||||
* Build a query string
|
* Build a query string
|
||||||
|
|
@ -1208,10 +1178,10 @@ WebGUI.Admin.Tree.prototype.findCheckbox
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* formatActions ( )
|
* formatHelpers ( )
|
||||||
* Format the Edit and More links for the row
|
* Format the Edit and More links for the row
|
||||||
*/
|
*/
|
||||||
WebGUI.Admin.Tree.prototype.formatActions
|
WebGUI.Admin.Tree.prototype.formatHelpers
|
||||||
= function ( elCell, oRecord, oColumn, orderNumber ) {
|
= function ( elCell, oRecord, oColumn, orderNumber ) {
|
||||||
if ( oRecord.getData( 'canEdit' ) ) {
|
if ( oRecord.getData( 'canEdit' ) ) {
|
||||||
var edit = document.createElement("span");
|
var edit = document.createElement("span");
|
||||||
|
|
@ -1224,23 +1194,13 @@ WebGUI.Admin.Tree.prototype.formatActions
|
||||||
elCell.appendChild( document.createTextNode( " | " ) );
|
elCell.appendChild( document.createTextNode( " | " ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return; // TODO
|
|
||||||
var more = document.createElement( 'a' );
|
var more = document.createElement( 'a' );
|
||||||
elCell.appendChild( more );
|
elCell.appendChild( more );
|
||||||
more.appendChild( document.createTextNode( window.admin.i18n.get('Asset','More' ) ) );
|
more.appendChild( document.createTextNode( window.admin.i18n.get('Asset','More' ) ) );
|
||||||
more.href = '#';
|
more.href = '#';
|
||||||
|
|
||||||
// Delete the old menu
|
// Build onclick handler to show more menu
|
||||||
if ( document.getElementById( 'moreMenu' + oRecord.getData( 'assetId' ) ) ) {
|
|
||||||
var oldMenu = document.getElementById( 'moreMenu' + oRecord.getData( 'assetId' ) );
|
|
||||||
oldMenu.parentNode.removeChild( oldMenu );
|
|
||||||
}
|
|
||||||
|
|
||||||
var options = this.buildMoreMenu(oRecord.getData( 'url' ), more, oRecord.getData( 'canEdit' ));
|
|
||||||
|
|
||||||
var menu = new YAHOO.widget.Menu( "moreMenu" + oRecord.getData( 'assetId' ), options );
|
|
||||||
YAHOO.util.Event.onDOMReady( function () { menu.render( document.getElementById( 'assetManager' ) ); } );
|
|
||||||
YAHOO.util.Event.addListener( more, "click", function (e) { YAHOO.util.Event.stopEvent(e); menu.show(); menu.focus(); }, null, menu );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue