mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-09-06 17:51:16 +02:00
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98732 467b73ca-7a2a-4603-9d3b-597d59a354a9
36 lines
1.3 KiB
JavaScript
Executable File
36 lines
1.3 KiB
JavaScript
Executable File
/**
|
|
* CAUTION: Assumes that a MemberTableField-instance is present as an editing form
|
|
*/
|
|
function action_addmember_right() {
|
|
var memberTableFields = document.getElementsBySelector('#Form_EditForm div.MemberTableField');
|
|
var tables = document.getElementsBySelector('#Form_EditForm div.MemberTableField table');
|
|
var addLinks = document.getElementsBySelector('#Form_EditForm div.MemberTableField a.addlink');
|
|
memberTableFields[0].openPopup(null,addLinks[0].href,tables[0]);
|
|
}
|
|
|
|
(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
|
|
);
|
|
})
|
|
})(jQuery); |