ENHANCEMENT Using jQuery.get() to ajax-refresh the CMS tree, to allow for concrete-style behaviour and global ajax error handling through jQuery instead of prototypejs

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92724 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:15:44 +00:00
parent 49ff1648bd
commit 898665e54b

View File

@ -55,17 +55,15 @@ TreeAPI.prototype = {
url = this.url(args); url = this.url(args);
var self = this; var self = this;
new Ajax.Request(url, { jQuery.get(
onSuccess: function(response){ url,
self.innerHTML = response.responseText; function(data, status){
self.innerHTML = data;
self.castAsTreeNode(self.firstChild); self.castAsTreeNode(self.firstChild);
if (options.onSuccess) options.onSuccess(response); if (options.onSuccess) options.onSuccess(data);
}, },
onFailure: function(response){ 'html'
errorMessage('error loading tree', response); );
if (options.onFailure) options.onFailure(response);
}
});
}, },
/** /**