Index: lams_central/web/css/index.css =================================================================== diff -u -r1218529ca28ff950668391b2c54d254e5beddab2 -r75f5cb01345becd855033a4219dab63cb1c667a1 --- lams_central/web/css/index.css (.../index.css) (revision 1218529ca28ff950668391b2c54d254e5beddab2) +++ lams_central/web/css/index.css (.../index.css) (revision 75f5cb01345becd855033a4219dab63cb1c667a1) @@ -29,7 +29,7 @@ .dialogContainer iframe { width: 100%; - height: 99.4%; + height: 99%; border: none; } Index: lams_central/web/includes/javascript/dialog.js =================================================================== diff -u -raca771d94d7b2c7c6dccea8ff39d12e4167289b1 -r75f5cb01345becd855033a4219dab63cb1c667a1 --- lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision aca771d94d7b2c7c6dccea8ff39d12e4167289b1) +++ lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision 75f5cb01345becd855033a4219dab63cb1c667a1) @@ -4,12 +4,16 @@ * Checks if the dialog is already opened. * If not, creates a new dialog with the given ID and init parameters. */ -function showDialog(id, initParams, extraButtons) { +function showDialog(id, initParams, extraButtons, recreate) { var dialog = $('#' + id); + // is it open already? if (dialog.length > 0) { - // is it open already? - dialog.dialog('moveToTop'); - return; + if (recreate){ + dialog.dialog('close'); + } else { + dialog.dialog('moveToTop'); + return; + } } // create a new dialog by cloning a template Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== diff -u -rc48c8002ccae15f230099c704b48a39e7fe3a382 -r75f5cb01345becd855033a4219dab63cb1c667a1 --- lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision c48c8002ccae15f230099c704b48a39e7fe3a382) +++ lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 75f5cb01345becd855033a4219dab63cb1c667a1) @@ -435,26 +435,27 @@ $("#" + id).dialog('close'); } - -/** - * Loads contents to already open organisation groups dialog. - */ -function loadOrgGroupDialogContents(title, width, height, url) { - var dialog = $('#dialogOrgGroup'); - if (title) { - dialog.dialog('option', 'title', title); +function showOrgGroupDialogContents(title, width, height, url) { + var id = "dialogOrgGroup", + dialog = $('#' + id), + exists = dialog.length > 0, + orgID = null; + if (exists) { + if (!title) { + title = dialog.dialog('option', 'title'); + } + orgID = dialog.dialog('option', 'orgID'); } - if (width && height) { - dialog.dialog('option', { - 'width' : width, - 'height' : height, - }).dialog('option', 'position', 'center'); - } - if (url) { - $('iframe', dialog).contents().find("body").html(''); - $('iframe', dialog).attr('src', url); - $('div.ui-dialog-titlebar .customDialogButton').remove(); - } + showDialog(id, { + 'orgID' : orgID, + 'height' : height, + 'width' : width, + 'title' : title, + 'hide' : false, + 'open' : function() { + $('iframe', this).attr('src', url); + } + }, true, exists); } /** @@ -463,7 +464,7 @@ function saveOrgGroups() { var groupsSaved = $('#dialogOrgGroup iframe')[0].contentWindow.saveGroups(); if (groupsSaved) { - loadOrgGroupDialogContents(null, 460, 460, + showOrgGroupDialogContents(null, 460, 460, LAMS_URL + 'OrganisationGroup.do?method=viewGroupings&organisationID=' + $('#dialogOrgGroup').dialog('option', 'orgID')); } Index: lams_central/web/includes/javascript/orgGroup.js =================================================================== diff -u -rc9a44fe6578c49896d8b7c7200e4d74e960ffbdb -r75f5cb01345becd855033a4219dab63cb1c667a1 --- lams_central/web/includes/javascript/orgGroup.js (.../orgGroup.js) (revision c9a44fe6578c49896d8b7c7200e4d74e960ffbdb) +++ lams_central/web/includes/javascript/orgGroup.js (.../orgGroup.js) (revision 75f5cb01345becd855033a4219dab63cb1c667a1) @@ -25,7 +25,7 @@ } else { $('#groupingName').val(grouping.name); // move Save button to the titlebar, i.e. outside of this iframe to the enveloping dialog - $('div.ui-dialog-titlebar', window.parent.document).prepend($('.customDialogButton')); + $('div.ui-dialog-titlebar', window.parent.document).append($('.customDialogButton')); } if (canEdit) { Index: lams_central/web/includes/javascript/orgGrouping.js =================================================================== diff -u -r9611486dadb7a74fbe7d54b67cd1da4dbf6b3535 -r75f5cb01345becd855033a4219dab63cb1c667a1 --- lams_central/web/includes/javascript/orgGrouping.js (.../orgGrouping.js) (revision 9611486dadb7a74fbe7d54b67cd1da4dbf6b3535) +++ lams_central/web/includes/javascript/orgGrouping.js (.../orgGrouping.js) (revision 75f5cb01345becd855033a4219dab63cb1c667a1) @@ -33,6 +33,6 @@ } } else { // load to dialog - window.parent.loadOrgGroupDialogContents(null, 880, 460, url); + window.parent.showOrgGroupDialogContents(null, 880, 500, url); } } \ No newline at end of file Index: lams_central/web/orgGroup.jsp =================================================================== diff -u -r9611486dadb7a74fbe7d54b67cd1da4dbf6b3535 -r75f5cb01345becd855033a4219dab63cb1c667a1 --- lams_central/web/orgGroup.jsp (.../orgGroup.jsp) (revision 9611486dadb7a74fbe7d54b67cd1da4dbf6b3535) +++ lams_central/web/orgGroup.jsp (.../orgGroup.jsp) (revision 75f5cb01345becd855033a4219dab63cb1c667a1) @@ -58,13 +58,13 @@ - + + onClick="javascript:showOrgGroupDialogContents(null, 460, 460,'OrganisationGroup.do?method=viewGroupings&organisationID=' + $('#dialogOrgGroup').dialog('option', 'orgID'))" + style="right: 170px;">