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) {