Commit f6390e05 authored by weibel manuel - mweibel's avatar weibel manuel - mweibel
Browse files

Update paul.js

Bugfix collapsible course-sections from Edwiser
parent 591aec21
<script type="text/javascript">
// // // // //
// Version 2019/10/01 by Wema
// Version 2019/10/17 by Wema
// // // // //
var headers1 = document.getElementsByTagName('h1');
var headers2 = document.getElementsByTagName('h2');
......@@ -302,13 +302,31 @@ if(location.href.includes("user/index.php?")){
/* Wema Ende: Maintenance-Info */
/* Wema Start: Expand collapsible course-sections by url (from Edwiser) */
if (document.querySelector('body').id == 'page-course-view-remuiformat') {
window.onhashchange = function() {
var elid = window.location.hash;
if (document.querySelector(elid) && document.querySelector(elid).querySelector('.fa-angle-down')) {
document.querySelector(elid).querySelector('.fa-angle-down').click();
if (document.body.id == 'page-course-view-remuiformat') {
document.addEventListener('DOMContentLoaded', function() {
var list = document.querySelectorAll('.remui-format-list .section>.list-current');
var openList = [];
if (list.length != 0) {
list.forEach(function(elem, index) {
openList.push(elem.parentElement);
});
list = null;
}
};
if (window.location.hash != '') {
openList.push(document.querySelector(window.location.hash));
}
openList.forEach(function(elem) {
elem.querySelector('.card-footer').classList.remove('collpase');
elem.querySelector('.card-footer').classList.add('show');
});
});
window.addEventListener('hashchange', function() {
if (window.location.hash != '' && document.querySelector(window.location.hash)) {
var elem = document.querySelector(window.location.hash);
elem.querySelector('.card-footer').classList.remove('collpase');
elem.querySelector('.card-footer').classList.add('show');
}
});
}
/* Wema Ende: Expand collapsible course-sections by url (from Edwiser) */
</script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment