Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 8847506322dc4e47a3c218f51a49d66dddde8069 1 parent 9c697f4
Ingo Schommer authored June 03, 2012
10  javascript/CMSMain.AddForm.js
@@ -111,8 +111,16 @@
111 111
 	
112 112
 		$(".cms-page-add-button").entwine({
113 113
 			onclick: function(e) {
114  
-				$('.cms-page-add-form-dialog').dialog('open');
  114
+				var selected = $('.cms-tree').jstree('get_selected'),
  115
+					parentId = selected ? $(selected[0]).data('id') : null,
  116
+					data = {selector: this.data('targetPanel'),pjax: this.data('pjax')},
  117
+					url = parentId ? ss.i18n.sprintf(this.data('urlAddpage'), parentId) : this.attr('href');
  118
+
  119
+				$('.cms-container').loadPanel(url, null, data);
115 120
 				e.preventDefault();
  121
+
  122
+				// $('.cms-page-add-form-dialog').dialog('open');
  123
+				// e.preventDefault();
116 124
 			}
117 125
 		});
118 126
 	});
2  templates/Includes/CMSPagesController_ContentToolActions.ss
... ...
@@ -1,5 +1,5 @@
1 1
 <div class="cms-actions-row">
2  
-	<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>
  2
+	<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>
3 3
 </div>
4 4
 
5 5
 <div class="cms-content-batchactions">

0 notes on commit 8847506

Please sign in to comment.
Something went wrong with that request. Please try again.