From b055154586f30267fa05b2a00b10927add036131 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 31 Mar 2010 03:28:43 +0000 Subject: [PATCH] BUGFIX Fixed "object not found" javascript error in SecurityAdmin_right.js when changing group nodes (fixes #5179) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@101956 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/SecurityAdmin_right.js | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/javascript/SecurityAdmin_right.js b/javascript/SecurityAdmin_right.js index e9e8e163..e3b1cfa0 100755 --- a/javascript/SecurityAdmin_right.js +++ b/javascript/SecurityAdmin_right.js @@ -9,28 +9,28 @@ function action_addmember_right() { } (function($) { - $(document).ready(function() { - var refreshAfterImport = function(e) { - // Check for a message
, an indication that the form has been submitted. - var existingFormMessage = $($(this).contents()).find('.message'); - if(existingFormMessage && existingFormMessage.html()) { - // Refresh member listing - var memberTableField = $(window.parent.document).find('#Form_EditForm_Members').get(0); - if(memberTableField) memberTableField.refresh(); - - // Refresh tree - var tree = $(window.parent.document).find('#sitetree').get(0); - if(tree) tree.reload(); - } - }; - /** * Refresh the member listing every time the import iframe is loaded, * which is most likely a form submission. */ $('#MemberImportFormIframe,#GroupImportFormIframe').livequery( 'load', - refreshAfterImport + function(e) { + // Get iframe content + var doc = this.document || this.contentDocument || this.contentWindow && this.contentWindow.document || null; + if(!doc) return; + + // Check for a message
, an indication that the form has been submitted. + var existingFormMessage = $(doc.body).find('.message'); + if(existingFormMessage && existingFormMessage.html()) { + // Refresh member listing + var memberTableField = $(window.parent.document).find('#Form_EditForm_Members').get(0); + if(memberTableField) memberTableField.refresh(); + + // Refresh tree + var tree = $(window.parent.document).find('#sitetree').get(0); + if(tree) tree.reload(); + } + } ); - }) })(jQuery); \ No newline at end of file