From 1f3a97235b1845cb4bd818db8726306ace55922f Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 8 Oct 2010 12:36:24 -0500 Subject: [PATCH] remove rank from default assettable. only in tree --- www/extras/admin/admin.js | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/www/extras/admin/admin.js b/www/extras/admin/admin.js index f0d6107a4..a4e8abe6b 100644 --- a/www/extras/admin/admin.js +++ b/www/extras/admin/admin.js @@ -3,6 +3,9 @@ /** * WebGUI.Admin -- The WebGUI Admin Console */ +bind = function ( scope, func ) { + return function() { func.apply( scope, arguments ) } +}; if ( typeof WebGUI == "undefined" ) { WebGUI = {}; @@ -1143,56 +1146,46 @@ WebGUI.Admin.AssetTable } }; - var makeScopedFormatter = function ( scope, func ) { - return function() { func.apply( scope, arguments ) } - }; - this.columnDefs = [ { key: 'assetId', label: selectAllSpan.innerHTML, - formatter: makeScopedFormatter( this, this.formatAssetIdCheckbox ) - }, - { - key: 'lineage', - label: window.admin.i18n.get('Asset','rank'), - sortable: true, - formatter: makeScopedFormatter( this, this.formatRank ) + formatter: bind( this, this.formatAssetIdCheckbox ) }, { key: 'helpers', label: "", - formatter: makeScopedFormatter( this, this.formatHelpers ) + formatter: bind( this, this.formatHelpers ) }, { key: 'title', label: window.admin.i18n.get('Asset', '99'), - formatter: makeScopedFormatter( this, this.formatTitle ), + formatter: bind( this, this.formatTitle ), sortable: true }, { key: 'className', label: window.admin.i18n.get('Asset','type'), sortable: true, - formatter: makeScopedFormatter( this, this.formatClassName ) + formatter: bind( this, this.formatClassName ) }, { key: 'revisionDate', label: window.admin.i18n.get('Asset','revision date' ), - formatter: makeScopedFormatter( this, this.formatRevisionDate ), + formatter: bind( this, this.formatRevisionDate ), sortable: true }, { key: 'assetSize', label: window.admin.i18n.get('Asset','size' ), - formatter: makeScopedFormatter( this, this.formatAssetSize ), + formatter: bind( this, this.formatAssetSize ), sortable: true }, { key: 'lockedBy', label: '', - formatter: makeScopedFormatter( this, this.formatLockedBy ) + formatter: bind( this, this.formatLockedBy ) } ]; }; @@ -1603,6 +1596,14 @@ WebGUI.Admin.Tree paginatorIds : [ 'treePaginator' ] } ); + // Add Rank column for ordering + this.columnDefs.splice( 1, 0, { + key: 'lineage', + label: window.admin.i18n.get('Asset','rank'), + sortable: true, + formatter: bind( this, this.formatRank ) + } ); + this.init(); }; YAHOO.lang.extend( WebGUI.Admin.Tree, WebGUI.Admin.AssetTable );