@caspingus/lt
Version:
A utility library of helpers and extensions useful when working with Learnosity APIs.
32 lines (31 loc) • 1.22 kB
JavaScript
import { r as e, t } from "../../extensionsFactory-hk5ijx1G.js";
import { t as n } from "../../styling-D2uWYs0R.js";
//#region src/authoring/extensions/validation/singleQuestion/index.js
var r = {
classNamePrefix: null,
elements: {}
};
function i() {
c(), t.authorApp().on("render:item", a), t.authorApp().on("render:widgets", a), t.authorApp().on("itemedit:changed", a);
}
function a() {
r.classNamePrefix = n(r.classNamePrefix), t.authorApp().getItem().questions.length ? o() : s();
}
function o() {
let e = r.elements.apiWrapper.querySelectorAll("[data-authorapi-selector=\"add-button\"]"), t = r.elements.apiWrapper.querySelectorAll(".lrn-author-ui-add-extras"), n = [...e, ...t];
n && n.forEach((e) => {
e.classList.add(`lrn-${r.classNamePrefix}hide`);
});
}
function s() {
let e = r.elements.apiWrapper.querySelectorAll("[data-authorapi-selector=\"add-button\"]"), t = r.elements.apiWrapper.querySelectorAll(".lrn-author-ui-add-extras"), n = [...e, ...t];
n && n.forEach((e) => {
e.classList.remove(`lrn-${r.classNamePrefix}hide`);
});
}
function c() {
r.elements.apiWrapper = document.querySelector(".lrn-author");
}
var l = e("singleQuestion", i);
//#endregion
export { l as singleQuestion };