From 1e578a32cb2c790c5f84457ec8d06e8c7912230d Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 8 Oct 2008 01:10:59 +0000 Subject: [PATCH] MINOR Fixed JS undefined errors with 'addgroup' and 'deletegroup' elements git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63802 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/SecurityAdmin_left.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/javascript/SecurityAdmin_left.js b/javascript/SecurityAdmin_left.js index 3bd35c96..e5801151 100755 --- a/javascript/SecurityAdmin_left.js +++ b/javascript/SecurityAdmin_left.js @@ -137,13 +137,17 @@ deletegroup = { Behaviour.addLoader(function () { // Set up add page Observable.applyTo($('addgroup_options')); - $('addgroup').onclick = addgroup.button_onclick; - $('addgroup').getElementsByTagName('button')[0].onclick = function() {return false;}; - $('addgroup_options').onsubmit = addgroup.form_submit; + if($('addgroup')) { + $('addgroup').onclick = addgroup.button_onclick; + $('addgroup').getElementsByTagName('button')[0].onclick = function() {return false;}; + $('addgroup_options').onsubmit = addgroup.form_submit; + } // Set up delete page Observable.applyTo($('deletegroup_options')); - $('deletegroup').onclick = deletegroup.button_onclick; - $('deletegroup').getElementsByTagName('button')[0].onclick = function() {return false;}; - $('deletegroup_options').onsubmit = deletegroup.form_submit; + if($('deletegroup')) { + $('deletegroup').onclick = deletegroup.button_onclick; + $('deletegroup').getElementsByTagName('button')[0].onclick = function() {return false;}; + $('deletegroup_options').onsubmit = deletegroup.form_submit; + } }); \ No newline at end of file