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
This commit is contained in:
Ingo Schommer 2010-03-31 03:28:43 +00:00 committed by Sam Minnee
parent 1a3a8d0a0c
commit b055154586

View File

@ -9,28 +9,28 @@ function action_addmember_right() {
}
(function($) {
$(document).ready(function() {
var refreshAfterImport = function(e) {
// Check for a message <div>, 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 <div>, 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);