Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Selecting correct parent when adding a new page (fixes #7188)

  • Loading branch information...
commit 8847506322dc4e47a3c218f51a49d66dddde8069 1 parent 9c697f4
@chillu chillu authored
View
10 javascript/CMSMain.AddForm.js
@@ -111,8 +111,16 @@
$(".cms-page-add-button").entwine({
onclick: function(e) {
- $('.cms-page-add-form-dialog').dialog('open');
+ var selected = $('.cms-tree').jstree('get_selected'),
+ parentId = selected ? $(selected[0]).data('id') : null,
+ data = {selector: this.data('targetPanel'),pjax: this.data('pjax')},
+ url = parentId ? ss.i18n.sprintf(this.data('urlAddpage'), parentId) : this.attr('href');
+
+ $('.cms-container').loadPanel(url, null, data);
e.preventDefault();
+
+ // $('.cms-page-add-form-dialog').dialog('open');
+ // e.preventDefault();
}
});
});
View
2  templates/Includes/CMSPagesController_ContentToolActions.ss
@@ -1,5 +1,5 @@
<div class="cms-actions-row">
- <a class="cms-page-add-button ss-ui-button ss-ui-action-constructive cms-panel-link" data-icon="add" href="$LinkPageAdd"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
+ <a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd}?ParentID=%s"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
</div>
<div class="cms-content-batchactions">
Please sign in to comment.
Something went wrong with that request. Please try again.