From 898665e54b9b7f479cea20ada998a2fb5a0ee32f Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:15:44 +0000 Subject: [PATCH] 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 --- javascript/LeftAndMain_left.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/javascript/LeftAndMain_left.js b/javascript/LeftAndMain_left.js index f7d88564..cc3a91cf 100755 --- a/javascript/LeftAndMain_left.js +++ b/javascript/LeftAndMain_left.js @@ -55,17 +55,15 @@ TreeAPI.prototype = { url = this.url(args); var self = this; - new Ajax.Request(url, { - onSuccess: function(response){ - self.innerHTML = response.responseText; + jQuery.get( + url, + function(data, status){ + self.innerHTML = data; self.castAsTreeNode(self.firstChild); - if (options.onSuccess) options.onSuccess(response); + if (options.onSuccess) options.onSuccess(data); }, - onFailure: function(response){ - errorMessage('error loading tree', response); - if (options.onFailure) options.onFailure(response); - } - }); + 'html' + ); }, /**