mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
MINOR JS bug (missing ')')
MINOR check that SiteTree exists before trying to write to it (from r82342)
This commit is contained in:
parent
b40af7d2e3
commit
4801838dd0
@ -3,9 +3,11 @@ Behaviour.register({
|
|||||||
onchange: function() {
|
onchange: function() {
|
||||||
var request = new Ajax.Request(SiteTreeHandlers.controller_url + '/changesubsite?SubsiteID=' + this.value + '&ajax=1', {
|
var request = new Ajax.Request(SiteTreeHandlers.controller_url + '/changesubsite?SubsiteID=' + this.value + '&ajax=1', {
|
||||||
onSuccess: function(response) {
|
onSuccess: function(response) {
|
||||||
$('sitetree').innerHTML = response.responseText;
|
if ($('sitetree')) {
|
||||||
SiteTree.applyTo($('sitetree'));
|
$('sitetree').innerHTML = response.responseText;
|
||||||
$('sitetree').getTreeNodeByIdx(0).onselect();
|
SiteTree.applyTo($('sitetree'));
|
||||||
|
$('sitetree').getTreeNodeByIdx(0).onselect();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onFailure: function(response) {
|
onFailure: function(response) {
|
||||||
|
@ -28,7 +28,7 @@ SubsitesTreeDropdownField.prototype = {
|
|||||||
|
|
||||||
// This if block is necessary to maintain both 2.2 and 2.3 support
|
// 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();
|
||||||
|
|
||||||
if(baseURL.match('action_callfieldmethod')) var ajaxURL = baseURL+ '&methodName=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();
|
else var ajaxURL = baseURL+ 'getsubtree?SubtreeRootID=' + this.getIdx();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user