Index: lams_central/web/includes/javascript/dialog.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/dialog.js,v diff -u -r1.1.2.21 -r1.1.2.22 --- lams_central/web/includes/javascript/dialog.js 9 Dec 2016 17:45:54 -0000 1.1.2.21 +++ lams_central/web/includes/javascript/dialog.js 9 Dec 2016 18:46:20 -0000 1.1.2.22 @@ -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 +}