fixes
diff --git a/scripts/lms/dtech.js b/scripts/lms/dtech.js
index d85c687..d0a17dc 100644
--- a/scripts/lms/dtech.js
+++ b/scripts/lms/dtech.js
@@ -572,6 +572,7 @@
}
//Enable What-If grades
+ var scrollListenerAdded = false;
dtpsLMS.gradebookDidRender = function (course) {
//Add event listeners for every editable score in the gradebook
$(".card.outcomeResults .assessments .editableScore").toArray().forEach(ele => {
@@ -584,15 +585,18 @@
});
//Keep the grade summary on top
- var navbar = document.getElementById("gradeSummary");
- var sticky = navbar.offsetTop - 80;
- window.onscroll = function () {
- if (window.pageYOffset >= sticky) {
- $(".classContent").addClass("fixedGradeSummary");
- } else {
- $(".classContent").removeClass("fixedGradeSummary");
- }
- };
+ if (!scrollListenerAdded) {
+ scrollListenerAdded = true;
+ var gradeSummary = document.getElementById("gradeSummary");
+ var sticky = gradeSummary.offsetTop - parseFloat($("body").css("padding-top")) - 10;
+ window.onscroll = function () {
+ if (window.pageYOffset >= sticky) {
+ $(".classContent").addClass("fixedGradeSummary");
+ } else {
+ $(".classContent").removeClass("fixedGradeSummary");
+ }
+ };
+ }
}
//Adds a What-If grade listener to the provided element
@@ -653,7 +657,7 @@
function placeCaretAtEnd(el) {
el.focus();
if (typeof window.getSelection != "undefined"
- && typeof document.createRange != "undefined") {
+ && typeof document.createRange != "undefined") {
var range = document.createRange();
range.selectNodeContents(el);
range.collapse(false);
diff --git a/scripts/pages-discussions.js b/scripts/pages-discussions.js
index 65e4503..5b37fd6 100644
--- a/scripts/pages-discussions.js
+++ b/scripts/pages-discussions.js
@@ -279,9 +279,9 @@
//Render HTML
if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
jQuery(".classContent").html((fromModules ? /*html*/`
- <div class="acrylicMaterial" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')" style="line-height: 40px;display: inline-block;border-radius: 20px;margin: 82px 0px 0px 82px; cursor: pointer;">
- <div style="font-size: 16px;display: inline-block;vertical-align: middle;margin: 0px 20px;"><i style="vertical-align: middle;" class="material-icons">keyboard_arrow_left</i> Back</div>
- </div>
+ <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
+ <i class="material-icons">keyboard_arrow_left</i> Back
+ </button>
` : "") + postHTML.join(""));
}
}).catch(function (err) {
@@ -452,7 +452,7 @@
dtpsLMS.fetchPageContent(dtps.classes[classNum].id, pageID).then(function (page) {
if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
//Get computed background and text color to style the iFrame with
- var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
+ var computedBackgroundColor = getComputedStyle($(".classContent")[0]).getPropertyValue("--background");
var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
//Generate a blob with the page content and get its data URL
@@ -469,9 +469,9 @@
//Render page card in the class content
jQuery(".classContent").html(/*html*/`
${fromModules ? /*html*/`
- <div class="acrylicMaterial" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')" style="line-height: 40px;display: inline-block;border-radius: 20px;margin: 82px 0px 0px 82px; cursor: pointer;">
- <div style="font-size: 16px;display: inline-block;vertical-align: middle;margin: 0px 20px;"><i style="vertical-align: middle;" class="material-icons">keyboard_arrow_left</i> Back</div>
- </div>
+ <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
+ <i class="material-icons">keyboard_arrow_left</i> Back
+ </button>
` : ""}
<div style="margin: 20px; padding: 20px;">
<!-- Page title -->