mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT: Update Asset's left and right panels with filders and files 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
This commit is contained in:
parent
b8338bc2bc
commit
75f12d5a7e
@ -38,7 +38,8 @@ class AssetAdmin extends LeftAndMain {
|
|||||||
'sync',
|
'sync',
|
||||||
'uploadiframe',
|
'uploadiframe',
|
||||||
'UploadForm',
|
'UploadForm',
|
||||||
'deleteUnusedThumbnails' => 'ADMIN'
|
'deleteUnusedThumbnails' => 'ADMIN',
|
||||||
|
'SitetreeAsUL'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -342,13 +342,25 @@ FilesystemSyncClass.prototype = {
|
|||||||
|
|
||||||
onclick : function() {
|
onclick : function() {
|
||||||
statusMessage('Looking for new files');
|
statusMessage('Looking for new files');
|
||||||
new Ajax.Request('admin/assets/sync', {
|
new Ajax.Request('admin/assets/sync', {
|
||||||
onSuccess: function(t) {
|
onSuccess: function(t) {
|
||||||
statusMessage(t.responseText, "good");
|
statusMessage(t.responseText, "good");
|
||||||
},
|
|
||||||
onFailure: function(t) {
|
// Refresh asset tree
|
||||||
errorMessage("There was an error looking for new files");
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user