mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
elofgren: BUGFIX: Make adding newsletter types work again (was broken by r38923). Fix long-standing problem of whole page reloading when adding a Newsletter type. Now it is always added via AJAX.
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42006 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
456ce4ebcc
commit
ed0232eb71
@ -256,12 +256,15 @@ AddForm.prototype = {
|
||||
|
||||
form_submit : function() {
|
||||
var st = $('sitetree');
|
||||
|
||||
if( st.selected.length )
|
||||
if (st) {
|
||||
if( st.selected && st.selected.length ) {
|
||||
selectedNode = st.selected[0];
|
||||
else
|
||||
} else {
|
||||
selectedNode = st.selected;
|
||||
|
||||
}
|
||||
} else {
|
||||
var selectedNode = null;
|
||||
}
|
||||
var parentID = null;
|
||||
|
||||
while( selectedNode && !parentID ) {
|
||||
@ -275,8 +278,9 @@ AddForm.prototype = {
|
||||
alert("You have to save a page before adding children underneath it");
|
||||
|
||||
} else {
|
||||
|
||||
if (this.elements) {
|
||||
this.elements.ParentID.value = parentID;
|
||||
}
|
||||
|
||||
var type = 'draft';
|
||||
var selectIDPrefix = 'draft_' + parentID + '_';
|
||||
|
@ -27,4 +27,7 @@
|
||||
</li>
|
||||
<% end_control %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<ul id="sitetree" class="tree unformatted">
|
||||
</ul>
|
||||
<% end_if %>
|
||||
|
Loading…
Reference in New Issue
Block a user