mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUFIX: SubsiteTreeDropdownField's ajaxExpansion for tree item didn't work. Kudo to Hamish
This commit is contained in:
parent
9e9cf9a4c2
commit
37f29d46a3
@ -32,10 +32,15 @@ SubsitesTreeDropdownField.prototype = {
|
||||
if(baseURL.match('action_callfieldmethod')) var ajaxURL = baseURL+ '&methodName=getsubtree&SubtreeRootID=' + this.getIdx();
|
||||
else var ajaxURL = baseURL+ 'getsubtree?SubtreeRootID=' + this.getIdx();
|
||||
|
||||
// Customized: Append subsiteid (evaluated in SubsitesVirtualPage.php)
|
||||
ajaxURL += '&' + this.id + '_SubsiteID=' + parseInt(this.subsiteID);
|
||||
// Find the root of the tree - this points to a list item in the tree, not the root div we actually want
|
||||
// @todo: We should be using framework API calls to find the tree
|
||||
var tree = this;
|
||||
while (tree && !tree.className.match(/(^| )SubsitesTreeDropdownField( |$)/)) tree = tree.parentNode;
|
||||
|
||||
// Customized: Append subsiteid (evaluated in SubsitesVirtualPage.php)
|
||||
ajaxURL += '&' + tree.id + '_SubsiteID=' + parseInt(tree.subsiteID);
|
||||
ajaxURL += $('SecurityID') ? '&SecurityID=' + $('SecurityID').value : '';
|
||||
|
||||
new Ajax.Request(ajaxURL, {
|
||||
onSuccess : this.installSubtree.bind(this),
|
||||
onFailure : function(response) { errorMessage('error loading subtree', response); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user