Skip to content

Commit

Permalink
Revert js to version in main as refresh does not use it
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Aug 31, 2024
1 parent b3ed9e3 commit faf9bb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 43 deletions.
22 changes: 1 addition & 21 deletions amd/build/modform.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/modform.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 6 additions & 21 deletions amd/src/modform.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
* along with Moodle. If not, see <http://www.gnu.org/licenses/>.
*
*
* @copyright 2022 Marcus Green
* @copyright 2024 Marcus Green
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

export const init = (courseid) => {
export const init = () => {

var selectAllCheckBox = document.getElementById('id_selectall');

selectAllCheckBox.addEventListener('click', e => { // Hidden.
selectAllCheckBox.addEventListener('click', e => {
// Hidden.
document.querySelectorAll("[id^='id_activity']").forEach(checkbox => {
checkbox.checked = e.target.checked ? true : false;
});
Expand All @@ -47,7 +48,7 @@ export const init = (courseid) => {
var id = e.currentTarget.id.split('_')[2];
var checkboxid = 'id_activitygroup_activity_' + id;
var checkbox = document.getElementById(checkboxid);
checkbox.checked = ! checkbox.checked;
checkbox.checked = !checkbox.checked;
configureSelectAll();
}

Expand All @@ -64,21 +65,5 @@ export const init = (courseid) => {
});
selectAllCheckBox.checked = allchecked;
}
window.onbeforeunload = function () { // Your Code here
return null; // return null to avoid pop up
};

window.onbeforeunload = null;

var modtypeSelect = document.getElementById('id_modtype');
modtypeSelect.addEventListener("change", function (event) {
event.preventDefault();
var modType = this.value;
const params = {
modtype: modType,
courseid: courseid
};
window.onbeforeunload = null;
// window.location.assign(Url.relativeUrl("admin/tool/driprelease/view.php", params, false));
});
};

0 comments on commit faf9bb1

Please sign in to comment.