Index: lams_central/web/includes/javascript/dialog.js =================================================================== diff -u -rbc06500eee15f72a86bd1cac541c42a185bc6047 -rae5c541e00aeec95c773cabc1629303e10f7ecc5 --- lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision bc06500eee15f72a86bd1cac541c42a185bc6047) +++ lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision ae5c541e00aeec95c773cabc1629303e10f7ecc5) @@ -315,10 +315,16 @@ //used by both /lams_central/web/main.jsp and /lams_monitoring/web/monitor.jsp pages function showNotificationsDialog(orgID, lessonID) { + + //check whether current window is a top level one (otherwise it's an iframe or popup) + var isTopLevelWindow = window.top == window.self; + //calculate width and height based on the dimensions of the window to which dialog is added + var dialogWindow = isTopLevelWindow ? $(window) : $(window.parent); + // if screen is narrow, then it is much longer - var width = Math.max(380, Math.min(800, $(window).width() - 60)), + var width = Math.max(380, Math.min(800, dialogWindow.width() - 60)), height = width < 798 ? 850 : 650; - height = Math.max(380, Math.min(height, $(window).height() - 30)); + height = Math.max(380, Math.min(height, dialogWindow.height() - 30)); var id = "dialogNotifications" + (lessonID ? "Lesson" + lessonID : "Org" + orgID); showDialog(id, { @@ -328,6 +334,8 @@ }, 'height': height, 'width' : width, + //dialog needs to be added to a top level window to avoid boundary limitations of the interim iframe + "isCreateInParentWindow" : !isTopLevelWindow, 'title' : LABELS.EMAIL_NOTIFICATIONS_TITLE, 'open' : function() { var dialog = $(this), @@ -345,4 +353,4 @@ } } }, true); -} \ No newline at end of file +}