Index: lams_central/web/css/main.css =================================================================== diff -u -r9fd56dbeeb6921d6b750e79abad45c8a46fb6caa -r1ea4aaf03ba7f6c4fa2719d88983efc63f100d80 --- lams_central/web/css/main.css (.../main.css) (revision 9fd56dbeeb6921d6b750e79abad45c8a46fb6caa) +++ lams_central/web/css/main.css (.../main.css) (revision 1ea4aaf03ba7f6c4fa2719d88983efc63f100d80) @@ -354,9 +354,10 @@ .dialogMin { overflow: hidden !important; padding: 0 !important; - margin: 0; + margin: 0 10px 0 0; float: left; position: static !important; + width: 257px !important; } .dialogMin .modal-title { Index: lams_central/web/includes/javascript/dialog.js =================================================================== diff -u -r78d3840bba4ebbc2d65e9d8d064f3fc209b189ab -r1ea4aaf03ba7f6c4fa2719d88983efc63f100d80 --- lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision 78d3840bba4ebbc2d65e9d8d064f3fc209b189ab) +++ lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision 1ea4aaf03ba7f6c4fa2719d88983efc63f100d80) @@ -121,7 +121,7 @@ position = position || { 'my' : 'top', 'at' : 'top+15px', - 'of' : 'body' + 'of' : window }; dialog.position(position); } @@ -144,6 +144,12 @@ modalContent.on('resize', function(event, ui){ dialog.width(ui.size.width + 15); dialog.height(ui.size.height + 15); + }).on('resizestart', function(){ + // disable iframe as a target + // so it does not consume mouse movement when shrinking the dialog + $('iframe', this).css('pointer-events', 'none'); + }).on('resizestop', function(){ + $('iframe', this).css('pointer-events', 'auto'); }); } }); @@ -154,13 +160,20 @@ var icon = $('i', this), wasMaxed = icon.hasClass('fa-clone'), internalDialog = $('.modal-dialog', dialog), - internalContent = $('.modal-content', dialog); + internalContent = $('.modal-content', dialog), + positionTarget = initParams.modal ? internalDialog : dialog; icon.toggleClass('fa-plus').toggleClass('fa-clone'); if (wasMaxed) { // restore dialog - internalDialog.width(dialog.data('oldWidth')); - internalContent.width(dialog.data('oldWidth')); - internalContent.height(dialog.data('oldHeight')); + var oldWidth = dialog.data('oldWidth'), + oldHeight = dialog.data('oldHeight'); + if (!initParams.modal) { + dialog.width(oldWidth + 15); + dialog.height(oldHeight + 15); + } + internalDialog.width(oldWidth); + internalContent.width(oldWidth); + internalContent.height(oldHeight); // enable resizing $('.ui-resizable-handle', dialog).show(); @@ -170,18 +183,24 @@ 'oldWidth' : internalContent.width(), 'oldHeight': internalContent.height() }); + if (!initParams.modal) { + dialog.css({ + 'width' : '100%', + 'height': '100%' + }); + } internalDialog.css({ 'width' : '100%', 'height': '100%' }); internalContent.css('width', 'calc(100% - 15px)'); - internalContent.height(internalDialog.height() - 50); + internalContent.height(internalDialog.height() - 20); // disable resizing $('.ui-resizable-handle', dialog).hide(); } // center the dialog - internalDialog.position({ + (initParams.modal ? internalDialog : dialog).position({ 'my' : 'top', 'at' : 'center top', 'of' : window @@ -198,14 +217,21 @@ // remove overlay dialog.siblings('.modal-backdrop').hide(); // move the dialog to the bar at the bottom - $('
').attr('id', 'dialogMinContainer').appendTo('body').append(dialog); + var minContainer = $('#dialogMinContainer'); + if (minContainer.length == 0) { + minContainer = $('
').attr('id', 'dialogMinContainer').appendTo('body'); + } + minContainer.append(dialog); // disable maximising $('.dialogMaximise', dialog).hide(); // disable rezising $('.ui-resizable-handle', dialog).hide(); } else { $('body').append(dialog); - $('#dialogMinContainer').remove(); + var minContainer = $('#dialogMinContainer'); + if (minContainer.children().length == 0) { + $('#dialogMinContainer').remove(); + } dialog.siblings('.modal-backdrop').show(); $('.dialogMaximise', dialog).show(); $('.ui-resizable-handle', dialog).show(); Index: lams_central/web/includes/javascript/main.js =================================================================== diff -u -r0650bcff8799aab6eb5b5149ae4d6556c3c6f11d -r1ea4aaf03ba7f6c4fa2719d88983efc63f100d80 --- lams_central/web/includes/javascript/main.js (.../main.js) (revision 0650bcff8799aab6eb5b5149ae4d6556c3c6f11d) +++ lams_central/web/includes/javascript/main.js (.../main.js) (revision 1ea4aaf03ba7f6c4fa2719d88983efc63f100d80) @@ -293,7 +293,7 @@ 'lessonID' : lessonID }, 'autoOpen' : false, - 'height': Math.max(380, Math.min(600, $(window).height() - 60)), + 'height': Math.max(380, Math.min(600, $(window).height() - 30)), 'width' : Math.max(380, Math.min(1024, $(window).width() - 60)), 'title' : LABELS.MONITORING_TITLE, 'open' : function() { @@ -333,8 +333,7 @@ 'data' : { 'orgID' : orgID }, - 'modal' : false, - 'height': Math.max(380, Math.min(740, $(window).height() - 60)), + 'height': Math.max(380, Math.min(740, $(window).height() - 30)), 'width' : Math.max(380, Math.min(850, $(window).width() - 60)), 'title' : LABELS.ADD_LESSON_TITLE, 'open' : function() { @@ -375,8 +374,8 @@ function showOrgGroupDialog(url) { $('#dialogOrgGrouping').modal('hide'); showDialog("dialogOrgGroup", { - 'width' : 850, - 'height': 470, + 'width' : Math.max(380, Math.min(850, $(window).width() - 60)), + 'height': Math.max(380, Math.min(470, $(window).height() - 30)), 'title' : LABELS.COURSE_GROUPS_TITLE, 'open' : function() { // load contents after opening the dialog @@ -392,8 +391,7 @@ 'toolID' : toolID, 'learningLibraryID' : learningLibraryID }, - 'modal' : false, - 'height' : Math.max(400, $(window).height() - 60), + 'height' : Math.max(400, $(window).height() - 30), 'width' : Math.max(380, Math.min(850, $(window).width() - 60)), 'title' : LABELS.SINGLE_ACTIVITY_LESSON_TITLE, 'open' : function() { @@ -436,9 +434,8 @@ 'orgID' : orgID, 'lessonID' : lessonID }, - 'height': Math.max(380, Math.min(650, $(window).height() - 60)), + 'height': Math.max(380, Math.min(650, $(window).height() - 30)), 'width' : Math.max(380, Math.min(800, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.EMAIL_NOTIFICATIONS_TITLE, 'open' : function() { var dialog = $(this), @@ -461,7 +458,7 @@ function showPrivateNotificationsDialog(){ var notificationDialog = showDialog("dialogPrivateNotifications", { - 'height': Math.max(380, Math.min(600, $(window).height() - 60)), + 'height': Math.max(380, Math.min(600, $(window).height() - 30)), 'width' : Math.max(380, Math.min(600, $(window).width() - 60)), 'title' : LABELS.PRIVATE_NOTIFICATIONS_TITLE, 'close' : function(){ @@ -505,9 +502,8 @@ var id = "dialoGradebookCourse" + orgID; showDialog(id, { 'orgID' : orgID, - 'height': Math.max(380, Math.min(650, $(window).height() - 60)), + 'height': Math.max(380, Math.min(650, $(window).height() - 30)), 'width' : Math.max(380, Math.min(800, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.GRADEBOOK_COURSE_TITLE, 'open' : function() { // load contents after opening the dialog @@ -523,9 +519,8 @@ 'data' : { 'lessonID' : lessonID }, - 'height': Math.max(380, Math.min(650, $(window).height() - 60)), + 'height': Math.max(380, Math.min(650, $(window).height() - 30)), 'width' : Math.max(380, Math.min(800, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.GRADEBOOK_LESSON_TITLE, 'open' : function() { var lessonID = $(this).data('lessonID'); @@ -547,7 +542,6 @@ // so just keep it always 400 'height' : 400, 'width' : Math.max(380, Math.min(750, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.GRADEBOOK_LEARNER_TITLE, 'open' : function() { var orgID = $(this).data('orgID'); @@ -564,9 +558,8 @@ 'data' : { 'lessonID' : lessonID }, - 'height': Math.max(380, Math.min(600, $(window).height() - 60)), + 'height': Math.max(380, Math.min(600, $(window).height() - 30)), 'width' : Math.max(380, Math.min(610, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.CONDITIONS_TITLE, 'open' : function() { var lessonID = $(this).data('lessonID'); @@ -583,9 +576,8 @@ 'data' : { 'orgID' : orgID }, - 'height': Math.max(380, Math.min(600, $(window).height() - 60)), + 'height': Math.max(380, Math.min(600, $(window).height() - 30)), 'width' : Math.max(380, Math.min(830, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.SEARCH_LESSON_TITLE, 'open' : function() { var orgID = $(this).data('orgID'); @@ -660,9 +652,8 @@ //used in main.jsp and /lti/addlesson.jsp function showAuthoringDialog(learningDesignID){ showDialog('dialogAuthoring', { - 'height' : Math.max(300, $(window).height() - 40), + 'height' : Math.max(300, $(window).height() - 30), 'width' : Math.max(600, Math.min(1280, $(window).width() - 60)), - 'modal' : false, 'title' : LABELS.AUTHORING_TITLE, 'beforeClose' : function(){ // if LD was modified, ask the user if he really wants to exit @@ -712,11 +703,10 @@ function showEmailDialog(userId, lessonId){ - var dialog = showDialog("dialogEmail", { 'autoOpen' : true, - 'height' : 700, - 'width' : 700, + 'height' : Math.max(380, Math.min(700, $(window).height() - 30)), + 'width' : Math.max(380, Math.min(700, $(window).width() - 60)), 'modal' : true, 'resizable' : true, 'title' : LABELS.EMAIL_TITLE,