Permalink
Browse files

ENHANCEMENT When loading CMS, ensure that "Parent page" tree dropdown is

either hidden or shown depending on initial "Page location" state
  • Loading branch information...
1 parent 677623c commit 614f307a37cbacdc08bc998ec5a238cc37b52b91 @halkyon halkyon committed Apr 23, 2012
Showing with 7 additions and 4 deletions.
  1. +1 −1 code/model/SiteTree.php
  2. +5 −2 javascript/CMSMain.EditForm.js
  3. +1 −1 lang/en.yml
View
@@ -1899,7 +1899,7 @@ function getSettingsFields() {
$parentTypeSelector = new CompositeField(
new OptionsetField("ParentType", _t("SiteTree.PAGELOCATION", "Page location"), array(
"root" => _t("SiteTree.PARENTTYPE_ROOT", "Top-level page"),
- "subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page (choose below)"),
+ "subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page"),
)),
$parentIDField = new TreeDropdownField("ParentID", $this->fieldLabel('ParentID'), 'SiteTree', 'ID', 'MenuTitle')
),
@@ -275,7 +275,10 @@
* radio button is selected
*/
$('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({
-
+ onmatch: function() {
+ this.onclick();
+ this._super();
+ },
/**
* Function: onclick
*
@@ -286,7 +289,7 @@
var parentTreeDropDown = $('.cms-edit-form.CMSPageSettingsController #ParentID');
if (e.target.id == 'Form_EditForm_ParentType_root') parentTreeDropDown.slideUp();
- else parentTreeDropDown.slideDown();
+ else parentTreeDropDown.slideDown();
}
});
View
@@ -338,7 +338,7 @@ en:
PARENTID: "Parent page"
PARENTTYPE: "Page location"
PARENTTYPE_ROOT: "Top-level page"
- PARENTTYPE_SUBPAGE: "Sub-page underneath a parent page (choose below)"
+ PARENTTYPE_SUBPAGE: "Sub-page underneath a parent page"
PERMISSION_GRANTACCESS_DESCRIPTION: "Manage access rights for content"
PERMISSION_GRANTACCESS_HELP: "Allow setting of page-specific access restrictions in the \"Pages\" section."
# Pural name of the object, used in dropdowns and to generally identify a collection of this object in the interface

0 comments on commit 614f307

Please sign in to comment.