when flipping between Tree and View tabs with edit on, clear out the containers for the toolbars before re-adding the toolbars -- this time in YUI

This commit is contained in:
Scott Walters 2013-09-12 12:03:41 -05:00
parent 6dbc6697c5
commit c19c3503d4
5 changed files with 26 additions and 13 deletions

View file

@ -1877,6 +1877,8 @@ WebGUI.Admin.Tree.prototype.runHelperForSelected
var self = this;
var assetIds = this.getSelected();
alert("ok");
// Open the dialog with two progress bars
var dialog = new YAHOO.widget.Panel( 'helperForkModalDialog', {
"width" : '350px',

View file

@ -32,6 +32,15 @@ WebGUI.Toolbar.createAll = function( ) {
var holders = YAHOO.util.Selector.query( '.wg-admin-toolbar' );
for ( var i = 0; i < holders.length; i++ ) {
var holder = holders[i];
// when flipping between Tree and View tabs with edit on, clear out the containers for the toolbars before re-adding the toolbars
var holder_yui = new YAHOO.util.Element( holder );
var child;
while( child = YAHOO.util.Dom.getFirstChild( holder ) ) {
holder_yui.removeChild( child );
// console.log("removing: " + child + " from " + holder_yui);
}
var assetId = holder.id.match( /wg-admin-toolbar-(.+)/ )[1];
var toolbar = new WebGUI.Toolbar( assetId, { "parent" : holder } );
toolbar.getAssetData( assetId, bind( toolbar, toolbar.render ) );