From 743dce78b7e4eb36aee49527035b9d303badf305 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 2 Oct 2008 10:11:08 +0000 Subject: [PATCH] ENHANCEMENT #1848 - Select the title field for new pages git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63528 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain_right.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/javascript/LeftAndMain_right.js b/javascript/LeftAndMain_right.js index fe2954a9..0019e9a3 100755 --- a/javascript/LeftAndMain_right.js +++ b/javascript/LeftAndMain_right.js @@ -136,6 +136,12 @@ CMSForm.prototype = { if(this.resetElements) this.resetElements(); window.ontabschanged(); + + // If there's a title field and it's got a "new XX" value, focus/select that first + // This is really a little too CMS-specific (as opposed to LeftAndMain), but the cleanup can happen after jQuery refactoring + if($('Form_EditForm_Title') && $('Form_EditForm_Title').value.match(/^new/i)) { + $('Form_EditForm_Title').select(); + } }, /** * Save the contens of the form, by submitting it and resetting is changed checker