Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 128... Línea 128...
128
            }
128
            }
129
            this.stateKey = Storage.get(`course/${courseId}/stateKey`);
129
            this.stateKey = Storage.get(`course/${courseId}/stateKey`);
130
        }
130
        }
Línea 131... Línea 131...
131
 
131
 
-
 
132
        this._loadFileHandlers();
-
 
133
 
132
        this._loadFileHandlers();
134
        this._pageAnchorCmInfo = this._scanPageAnchorCmInfo();
Línea 133... Línea 135...
133
    }
135
    }
134
 
136
 
135
    /**
137
    /**
Línea 361... Línea 363...
361
            notification.exception(error);
363
            notification.exception(error);
362
            // Force unlock all elements.
364
            // Force unlock all elements.
363
            super.dispatch('unlockAll');
365
            super.dispatch('unlockAll');
364
        }
366
        }
365
    }
367
    }
-
 
368
 
-
 
369
    /**
-
 
370
     * Calculate the cm info from the current page anchor.
-
 
371
     *
-
 
372
     * @returns {Object|null} the cm info or null if not found.
-
 
373
     */
-
 
374
    _scanPageAnchorCmInfo() {
-
 
375
        const anchor = new URL(window.location.href).hash;
-
 
376
        if (!anchor.startsWith('#module-')) {
-
 
377
            return null;
-
 
378
        }
-
 
379
        // The anchor is always #module-CMID.
-
 
380
        const cmid = anchor.split('-')[1];
-
 
381
        return this.stateManager.get('cm', parseInt(cmid));
-
 
382
    }
-
 
383
 
-
 
384
    /**
-
 
385
     * Return the current page anchor cm info.
-
 
386
     */
-
 
387
    getPageAnchorCmInfo() {
-
 
388
        return this._pageAnchorCmInfo;
-
 
389
    }
366
}
390
}