Skip to content

Commit

Permalink
refactor: address PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Sep 15, 2023
1 parent 85f3226 commit 4670b80
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions mindmap/public/js/src/mindmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@ function MindMapXBlock(runtime, element, context) {
const removeGradeURL = runtime.handlerUrl(element, "remove_grade");
const maxPointsAllowed = context.max_points;

var gettext;
if ("MindMapI18N" in window) {
console.log("Using MindMapI18N local translations");
// Use MindMapI18N local translations
gettext = window.MindMapI18N.gettext;
} else if ("gettext" in window) {
// Use edxapp's global translations
gettext = window.gettext;
let gettext;
if ("MindMapI18N" in window || "gettext" in window) {
gettext = window.MindMapI18N?.gettext || window.gettext;
}

if (typeof gettext == "undefined") {
// No translations -- used by test environment
gettext = function (string) {
return string;
};
gettext = (string) => string;
}

$(".card, .icon-collapsible").on("click", function () {
Expand Down

0 comments on commit 4670b80

Please sign in to comment.