MINOR JS bug (missing ')')

MINOR check that SiteTree exists before trying to write to it (from r82342)
This commit is contained in:
Tom Rix 2010-03-01 02:55:38 +00:00
parent b40af7d2e3
commit 4801838dd0
2 changed files with 6 additions and 4 deletions

View File

@ -3,9 +3,11 @@ Behaviour.register({
onchange: function() {
var request = new Ajax.Request(SiteTreeHandlers.controller_url + '/changesubsite?SubsiteID=' + this.value + '&ajax=1', {
onSuccess: function(response) {
$('sitetree').innerHTML = response.responseText;
SiteTree.applyTo($('sitetree'));
$('sitetree').getTreeNodeByIdx(0).onselect();
if ($('sitetree')) {
$('sitetree').innerHTML = response.responseText;
SiteTree.applyTo($('sitetree'));
$('sitetree').getTreeNodeByIdx(0).onselect();
}
},
onFailure: function(response) {

View File

@ -28,7 +28,7 @@ SubsitesTreeDropdownField.prototype = {
// This if block is necessary to maintain both 2.2 and 2.3 support
var baseURL = this.options.dropdownField.helperURLBase();
if(baseURL.match('action_callfieldmethod')) var ajaxURL = baseURL+ '&methodName=getsubtree&SubtreeRootID=' + this.getIdx();
else var ajaxURL = baseURL+ 'getsubtree?SubtreeRootID=' + this.getIdx();