diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index ec886d23..17a7377a 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -38,7 +38,8 @@ class AssetAdmin extends LeftAndMain { 'sync', 'uploadiframe', 'UploadForm', - 'deleteUnusedThumbnails' => 'ADMIN' + 'deleteUnusedThumbnails' => 'ADMIN', + 'SitetreeAsUL' ); /** diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index 144a2416..f83f1b4d 100755 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -342,13 +342,25 @@ FilesystemSyncClass.prototype = { onclick : function() { statusMessage('Looking for new files'); - new Ajax.Request('admin/assets/sync', { - onSuccess: function(t) { - statusMessage(t.responseText, "good"); - }, - onFailure: function(t) { - errorMessage("There was an error looking for new files"); - } + new Ajax.Request('admin/assets/sync', { + onSuccess: function(t) { + statusMessage(t.responseText, "good"); + + // Refresh asset tree + new Ajax.Request('admin/assets/SitetreeAsUL', { + onSuccess: function(t) { + Element.replace($('sitetree'), t.responseText); + SiteTree.applyTo('#sitetree'); + + // Reload the right panel + var sel = $('sitetree').firstSelected(); + if(sel !== undefined) sel.selectTreeNode(); + } + }); + }, + onFailure: function(t) { + errorMessage("There was an error looking for new files"); + } }); return false; }