Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT: Update Asset's left and right panels with filders and fi…

…les after 'Look for new files' was triggered (open #5543)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@113871 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 75f12d5a7ee234a5203c28b9c630abe0093a50c4 1 parent b8338bc
@phalkunz phalkunz authored sminnee committed
Showing with 21 additions and 8 deletions.
  1. +2 −1  code/AssetAdmin.php
  2. +19 −7 javascript/AssetAdmin.js
View
3  code/AssetAdmin.php
@@ -38,7 +38,8 @@ class AssetAdmin extends LeftAndMain {
'sync',
'uploadiframe',
'UploadForm',
- 'deleteUnusedThumbnails' => 'ADMIN'
+ 'deleteUnusedThumbnails' => 'ADMIN',
+ 'SitetreeAsUL'
);
/**
View
26 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.