mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX Selecting correct parent when adding a new page (fixes #7188)
This commit is contained in:
parent
9c697f4f52
commit
8847506322
@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -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">
|
||||
|
Loading…
x
Reference in New Issue
Block a user