Skip to content

Commit

Permalink
BUGFIX Selecting correct parent when adding a new page (fixes #7188)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Jun 3, 2012
1 parent 9c697f4 commit 8847506
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion javascript/CMSMain.AddForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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">
Expand Down

0 comments on commit 8847506

Please sign in to comment.