Skip to content

Commit

Permalink
Merge pull request #100 from WisdmLabs/dev40
Browse files Browse the repository at this point in the history
Merged dev40 into stable40
  • Loading branch information
jishan-ansari2000 authored Oct 23, 2024
2 parents 78582fe + c5432e1 commit c32a83a
Show file tree
Hide file tree
Showing 24 changed files with 1,023 additions and 459 deletions.
2 changes: 1 addition & 1 deletion amd/build/common.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/common.min.js.map

Large diffs are not rendered by default.

39 changes: 34 additions & 5 deletions amd/src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ define(['jquery'], function($) {
SHOW: 'show',
TOGGLE_HIGHLIGHT: '.section_action_menu .dropdown-item.editing_highlight',
TOGGLE_SHOWHIDE: '.section_action_menu .dropdown-item.editing_showhide',
DELETE: '.section_action_menu .dropdown-item.editing_delete',
BUTTON_HIDE: '.cm_action_menu .dropdown-menu .editing_hide',
BUTTON_SHOW: '.cm_action_menu .dropdown-menu .editing_show',
DELETE: '.section_action_menu .dropdown-item[data-action="deleteSection"]'
ACTIVITYBUTTON_HIDE: '.cm_action_menu .dropdown-menu [data-action="cmHide"]',
ACTIVITYBUTTON_SHOW: '.cm_action_menu .dropdown-menu [data-action="cmShow"]',
ACTIVITYDUPLICATE: '.cm_action_menu .dropdown-item.editing_duplicate',
ACTIVITIYDELETE: '.cm_action_menu .dropdown-item.editing_delete'
};

/**
Expand Down Expand Up @@ -79,7 +83,7 @@ define(['jquery'], function($) {
*/
function init() {

$('#page-course-view-remuiformat .section-modchooser-link').addClass("btn btn-primary");
$('#page-course-view-remuiformat .section-modchooser-link:not(.dropdown-item)').addClass("btn btn-primary");

adjustGeneralSectionActivities();
$(window).resize(function() {
Expand Down Expand Up @@ -111,19 +115,44 @@ define(['jquery'], function($) {
$('body').on('click', `${SELECTORS.TOGGLE_HIGHLIGHT},
${SELECTORS.TOGGLE_SHOWHIDE},
${SELECTORS.BUTTON_HIDE},
${SELECTORS.BUTTON_SHOW}`, function() {
${SELECTORS.BUTTON_SHOW},
${SELECTORS.ACTIVITYBUTTON_HIDE},
${SELECTORS.ACTIVITYBUTTON_SHOW}`, function() {
setTimeout(function() {
location.reload();
}, 400);
});

// Handling activity duplicate.
$('body').on('click', `${SELECTORS.ACTIVITYDUPLICATE}`, function() {
setTimeout(function() {
location.reload();
}, 200);
});

// Handling deleteAction
$('body').on('click', `${SELECTORS.DELETE}`, function(event) {
$('body').on('click', `${SELECTORS.ACTIVITIYDELETE},${SELECTORS.DELETE}`, function(event) {
event.preventDefault();
window.location.href = $(this).attr('href');
if($(this).attr('data-action') == 'cmDelete' ){
window.location.href = $(this).attr('href');
}
if($(this).attr('data-action') == 'deleteSection' ){
if(moodleversionbranch >= '405'){
location.reload();
}else{
window.location.href = $(this).attr('href');
}
}
return true;
});

// Handling addSubsection
$('body').on('click', '[data-action="addModule"]', function(event) {
setTimeout(() => {
location.reload();
}, 200);
return true;
});

var summaryheight = $('.read-more-target').height();

Expand Down
4 changes: 4 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGES LOG

Version 4.1.10
=============
Feature - Compatibility with Moodle 4.5.

Version 4.1.9
=============
Tweak - Miner improvement in 'Hide general section when empty' setting.
Expand Down
Loading

0 comments on commit c32a83a

Please sign in to comment.