BUGFIX: Improve stability of page dropdown on SubsitesVirtualPages (from r86097) (from r96275)

This commit is contained in:
Tom Rix 2010-03-01 21:56:55 +00:00
parent 298534fea1
commit 39421cbb73

View File

@ -14,12 +14,11 @@ SubsitesTreeDropdownField.prototype = {
}, },
ajaxGetTree: function(after) { ajaxGetTree: function(after) {
// This if block is necessary to maintain both 2.2 and 2.3 support
var baseURL = this.helperURLBase(); var baseURL = this.helperURLBase();
if(baseURL.match('action_callfieldmethod')) var ajaxURL = baseURL+ '&methodName=gettree&forceValues=' + this.inputTag.value; // Can't force value because it might be on a different subsite!
else var ajaxURL = baseURL+ 'gettree?forceValues=' + this.inputTag.value; var ajaxURL = baseURL+ 'gettree?forceValues=' + 0; //this.inputTag.value;
// Customized: Append subsiteid (evaluated in SubsitesVirtualPage.php) // Customised: Append subsiteid (evaluated in SubsitesVirtualPage.php)
ajaxURL += '&' + this.inputTag.name + '_SubsiteID=' + parseInt(this.subsiteID()); ajaxURL += '&' + this.inputTag.name + '_SubsiteID=' + parseInt(this.subsiteID());
ajaxURL += $('SecurityID') ? '&SecurityID=' + $('SecurityID').value : ''; ajaxURL += $('SecurityID') ? '&SecurityID=' + $('SecurityID').value : '';
@ -37,11 +36,8 @@ SubsitesTreeDropdownField.prototype = {
var ul = this.treeNodeHolder(); var ul = this.treeNodeHolder();
ul.innerHTML = ss.i18n._t('LOADING'); ul.innerHTML = ss.i18n._t('LOADING');
// This if block is necessary to maintain both 2.2 and 2.3 support
var baseURL = this.options.dropdownField.helperURLBase(); var baseURL = this.options.dropdownField.helperURLBase();
var ajaxURL = baseURL+ 'getsubtree?SubtreeRootID=' + this.getIdx();
if(baseURL.match('action_callfieldmethod')) var ajaxURL = baseURL+ '&methodName=getsubtree&SubtreeRootID=' + this.getIdx();
else var ajaxURL = baseURL+ 'getsubtree?SubtreeRootID=' + this.getIdx();
// Find the root of the tree - this points to a list item in the tree, not the root div we actually want // 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 // @todo: We should be using framework API calls to find the tree