Index: lams_central/web/includes/javascript/main.js =================================================================== diff -u -r2ce1ca7a4995e15743c5800fdd789868b0236836 -r9c8c589b55a98647f0e497d63f302568382fd83b --- lams_central/web/includes/javascript/main.js (.../main.js) (revision 2ce1ca7a4995e15743c5800fdd789868b0236836) +++ lams_central/web/includes/javascript/main.js (.../main.js) (revision 9c8c589b55a98647f0e497d63f302568382fd83b) @@ -292,7 +292,7 @@ function showMonitorLessonDialog(lessonID) { var id = "dialogMonitorLesson" + lessonID, - dialog = showDialog(id, { + dialog = showDialog(id, { 'data' : { 'isMonitorDialog' : true, 'lessonID' : lessonID @@ -308,15 +308,15 @@ + $(this).data('lessonID'), 'id' : 'monitorModal'}); }, - - }, true, true); + }, true, true); + + + // if it was just created if (dialog) { // tell the dialog contents that it was resized $('.modal-content', dialog).on('resizestop', resizeSequenceCanvas); - // initial resize - $('iframe', dialog).on('load', resizeSequenceCanvas); dialog.modal('show'); } @@ -326,11 +326,12 @@ * Adjust the position of LD SVG in Monitoring. */ function resizeSequenceCanvas(){ - $('div[id^="dialogMonitorLesson"] iframe').each(function(){ - var win = this.contentWindow || this.contentDocument; + $('div[id^="dialogMonitorLesson"]').each(function(){ + var iframe = $('iframe', this)[0], + win = iframe.contentWindow || iframe.contentDocument; if (win.resizeSequenceCanvas) { - var body = $(this).closest('.modal-body'); - win.resizeSequenceCanvas(body.width(), body.height()); + var body = $(this).find('.modal-body'); + win.resizeSequenceCanvas(body.height()); } }); }