From c56bc235bbb5f3df4a7c499e873f3832edb600dc Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 25 Sep 2024 10:31:12 +0100 Subject: [PATCH] New: Treat _isLocked as a lockable attribute --- js/models.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/models.js b/js/models.js index 81718b9..dbdfa90 100644 --- a/js/models.js +++ b/js/models.js @@ -197,13 +197,13 @@ export function applyLocks() { const modelsById = {}; // Fetch the component model from the store incase it needs overriding by another extension const TrickleButtonModel = components.getModelClass('trickle-button'); - const setDescendantLocks = ((model, id) => { + const setDescendantLocks = (model, id) => { model.getAllDescendantModels().forEach(descendant => { const descendantId = descendant.get('_id'); modelsById[descendantId] = descendant; locks[descendantId] = locks[id]; }); - }); + }; // Check all models for trickle potential Adapt.course.getAllDescendantModels(true).filter(model => model.get('_isAvailable')).forEach(siteModel => { const trickleConfig = getModelConfig(siteModel); @@ -236,7 +236,7 @@ export function applyLocks() { const model = modelsById[id]; const wasLocked = model.get('_isLocked'); if (wasLocked === isModelLocked) return; - model.set('_isLocked', isModelLocked); + model.set('_isLocked', isModelLocked, { pluginName: 'trickle' }); }); logTrickleState(); }