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

This commit is contained in:
Scott Walters 2013-09-12 10:02:39 -05:00
parent 85e09c41d6
commit 1ef7460815

View file

@ -32,6 +32,10 @@ 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
$(holder).empty();
var assetId = holder.id.match( /wg-admin-toolbar-(.+)/ )[1];
var toolbar = new WebGUI.Toolbar( assetId, { "parent" : holder } );
toolbar.getAssetData( assetId, bind( toolbar, toolbar.render ) );