Index: lams_central/web/includes/javascript/authoring/authoringMenu.js =================================================================== diff -u -raaf022d9434e595399eb5b62293291fe31e31be3 -r59d6a8fff94bedc882b4706f6d937aada6eb42e0 --- lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision aaf022d9434e595399eb5b62293291fe31e31be3) +++ lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision 59d6a8fff94bedc882b4706f6d937aada6eb42e0) @@ -315,12 +315,7 @@ cache : false, dataType : 'text', success : function() { - // open preview pop up window - var left = ((screen.width / 2) - (1280 / 2)), - // open the window a bit higher than center - top = ((screen.height / 2) - (720 / 2)) / 2; - window.open(LAMS_URL + 'home/learner.do?mode=preview&lessonID='+lessonID,'Preview', - 'width=1280,height=720,resizable,scrollbars=yes,status=yes,top=' + top + ',left=' + left); + window.open(LAMS_URL + 'home/learner.do?mode=preview&lessonID='+lessonID, '_blank'); previewButton.button('reset'); } }); @@ -512,7 +507,7 @@ } }, 'close' : function(){ - // stop checking in LD was + // stop checking in LD was clearInterval(loadCheckInterval); $(this).remove(); }, Index: lams_learning/web/includes/javascript/learnerPage.js =================================================================== diff -u -rb311244c55b221fc9f910cf4de25874d13d2296d -r59d6a8fff94bedc882b4706f6d937aada6eb42e0 --- lams_learning/web/includes/javascript/learnerPage.js (.../learnerPage.js) (revision b311244c55b221fc9f910cf4de25874d13d2296d) +++ lams_learning/web/includes/javascript/learnerPage.js (.../learnerPage.js) (revision 59d6a8fff94bedc882b4706f6d937aada6eb42e0) @@ -16,85 +16,89 @@ const ACTIVITY_ITEM_TEMPLATE = '
  • '; if (result.support) { let supportBarItems = $('.component-page-wrapper .offcanvas #offcanvas-support-bar') - .removeClass('d-none') + .removeClass('d-none') .find('#support-bar-items') .empty(); $.each(result.support, function (activityIndex, activityData) { let activityItem = $(ACTIVITY_ITEM_TEMPLATE) - .addClass('list-group-item list-group-item-action progress-bar-item-openable').appendTo(supportBarItems), + .addClass('list-group-item list-group-item-action progress-bar-item-openable').appendTo(supportBarItems), activityIcon = $('').attr({ - 'class': 'fa-solid fa-fw fa-lg fa-up-right-from-square progress-bar-icon', - 'title': LABEL_SUPPORT_ACTIVITY - }), - activityLink = $('').text(activityData.name).attr({ - 'target': '_blank', - 'href': activityData.url, - 'role': 'menuitem', - 'title': LABEL_CLICK_TO_OPEN - }); - $(".icon", activityItem).prepend(activityIcon); - $(".col", activityItem).append(activityLink); + 'class': 'fa-solid fa-fw fa-lg fa-up-right-from-square progress-bar-icon', + 'title': LABEL_SUPPORT_ACTIVITY + }), + activityLink = $('').text(activityData.name).attr({ + 'target': '_blank', + 'href': activityData.url, + 'role': 'menuitem', + 'title': LABEL_CLICK_TO_OPEN + }); + $(".icon", activityItem).prepend(activityIcon); + $(".col", activityItem).append(activityLink); }); } let progressBarItems = $('.component-page-wrapper .offcanvas #progress-bar-items').empty(), completedActivityCount = 0; $.each(result.activities, function (activityIndex, activityData) { let activityItem = $(ACTIVITY_ITEM_TEMPLATE) - .addClass('list-group-item list-group-item-action') - .appendTo(progressBarItems), + .addClass('list-group-item list-group-item-action') + .appendTo(progressBarItems), activityName = !activityData.name && activityData.type === 'g' ? 'Gate' : activityData.name, activityIcon = $(''); - $(".icon", activityItem).prepend(activityIcon); + $(".icon", activityItem).prepend(activityIcon); - //current + //current if (activityData.status === 0) { activityItem.addClass('active'); $(".col", activityItem).text(activityName); if (activityData.type === 'g') { activityIcon.addClass('fa-solid fa-unlock') - .attr('title', LABEL_CURRENT_GATE); - + .attr('title', LABEL_CURRENT_GATE); + } else { activityIcon.addClass('fa-regular fa-pen-to-square') - .attr('title', LABEL_CURRENT_ACTIVITY); + .attr('title', LABEL_CURRENT_ACTIVITY); } - - //completed - } else if (activityData.status === 1) { - completedActivityCount++; + } else { + let target = '_blank'; - activityItem.addClass('progress-bar-item-complete'); - if (activityData.type === 'g') { - activityIcon.addClass('fa-solid fa-lock-open') - .attr('title', LABEL_COMPLETED_GATE); - + //completed + if (activityData.status === 1) { + completedActivityCount++; + + activityItem.addClass('progress-bar-item-complete'); + if (activityData.type === 'g') { + activityIcon.addClass('fa-solid fa-lock-open') + .attr('title', LABEL_COMPLETED_GATE); + + } else { + activityIcon.addClass('fa-solid fa-square-check') + .attr('title', LABEL_COMPLETED_ACTIVITY); + } } else { - activityIcon.addClass('fa-solid fa-square-check') - .attr('title', LABEL_COMPLETED_ACTIVITY); + target = '_self'; + //not yet finished + activityItem.addClass('progress-bar-item-incomplete'); + if (activityData.type === 'g') { + activityIcon.addClass('fa-solid fa-lock') + .attr('title', LABEL_NOT_STARTED_GATE); + + } else { + activityIcon.addClass('fa-regular fa-square') + .attr('title', LABEL_NOT_STARTED_ACTIVITY); + } } if (activityData.url) { let activityLink = $('').text(activityName).attr({ - 'target': '_blank', + 'target': target, 'href': activityData.url, 'role': 'menuitem', 'title': LABEL_CLICK_TO_OPEN }); activityItem.addClass('progress-bar-item-openable'); $(".col", activityItem).append(activityLink); - } - - //not yet finished - } else { - activityItem.addClass('progress-bar-item-incomplete'); - $(".col", activityItem).text(activityName); - if (activityData.type === 'g') { - activityIcon.addClass('fa-solid fa-lock') - .attr('title', LABEL_NOT_STARTED_GATE); - } else { - activityIcon.addClass('fa-regular fa-square') - .attr('title', LABEL_NOT_STARTED_ACTIVITY); + $(".col", activityItem).text(activityName); } } }); @@ -170,7 +174,7 @@ progressBar = $('.component-page-wrapper .offcanvas'), topToggleButton = $('header #hamb', pageContent), isExpanded = forceClose || topToggleButton.attr('aria-expanded') == 'true'; - + topToggleButton.attr('aria-expanded', !isExpanded) .children('i').toggleClass(topToggleButton.data('closed-class')).toggleClass(topToggleButton.data('opened-class')); progressBar.toggleClass('active').attr('aria-expanded', !isExpanded);