From 4d106aa998ed02b8393e61ec99da8ba59e4745e4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 4 Dec 2012 11:29:05 +0100 Subject: [PATCH] BUG Fixed unintentional ParentID reset in "add page" form Side effects from old JS hanging around which was no longer used. See https://github.com/ajoneil/silverstripe-cms/commit/d364070941cab811646a5495033c90786662f51d for background discussion. --- admin/code/LeftAndMain.php | 1 - admin/javascript/LeftAndMain.AddForm.js | 168 ------------------------ 2 files changed, 169 deletions(-) delete mode 100644 admin/javascript/LeftAndMain.AddForm.js diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index b6f11ec01..38bada034 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -301,7 +301,6 @@ class LeftAndMain extends Controller implements PermissionProvider { FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Content.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.EditForm.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Menu.js', - FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js', FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.FieldHelp.js', diff --git a/admin/javascript/LeftAndMain.AddForm.js b/admin/javascript/LeftAndMain.AddForm.js deleted file mode 100644 index 8f7c20c26..000000000 --- a/admin/javascript/LeftAndMain.AddForm.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * File: LeftAndMain.AddForm.js - */ -(function($) { - $.entwine('ss', function($){ - /** - * Class: .add-form - * - * Simple form with a page type dropdown - * which creates a new page through .cms-edit-form and adds a new tree node. - * - * Requires: - * ss.i18n - * .cms-edit-form - */ - $('.cms-edit-form.cms-add-form').entwine({ - /** - * Variable: OrigOptions - * (Array) Map of ')); - disableDropDown = false; - } - }); - - // Disable dropdown if no elements are selectable - if (!disableDropDown) dropdown.removeAttr('disabled'); - else dropdown.attr('disabled', 'disabled'); - - //Re-select the currently selected element - if (selectedOption) dropdown.val(selectedOption); - - // Set default child (optional) - if(selectedNode.hints && selectedNode.hints.defaultChild) { - dropdown.val(selectedNode.hints.defaultChild); - } - - // Set parent node (fallback to root) - this.find(':input[name=ParentID]').val(selectedNode ? selectedNode.data('id') : 0); - } - }); - }); -}(jQuery));