Skip to content

Commit

Permalink
MDL-65298 core_course: Remove unused function parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Mar 5, 2020
1 parent d737452 commit f3c47c9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion course/amd/build/actions.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 course/amd/build/actions.min.js.map

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions course/amd/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
* @since 3.3
*/
define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str', 'core/url', 'core/yui',
'core/modal_factory', 'core/modal_events', 'core/key_codes'],
function($, ajax, templates, notification, str, url, Y, ModalFactory, ModalEvents, KeyCodes) {
'core/modal_factory', 'core/modal_events', 'core/key_codes', 'core/log'],
function($, ajax, templates, notification, str, url, Y, ModalFactory, ModalEvents, KeyCodes, log) {
var CSS = {
EDITINPROGRESS: 'editinprogress',
SECTIONDRAGGABLE: 'sectiondraggable',
Expand Down Expand Up @@ -341,13 +341,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
* @param {String} image new image name ("i/show", "i/hide", etc.)
* @param {String} stringname new string for the action menu item
* @param {String} stringcomponent
* @param {String} titlestr not used
* @param {String} titlecomponent not used
* @param {String} newaction new value for data-action attribute of the link
* @return {Promise} promise which is resolved when the replacement has completed
*/
var replaceActionItem = function(actionitem, image, stringname,
stringcomponent, titlestr, titlecomponent, newaction) {
stringcomponent, newaction) {

var stringRequests = [{key: stringname, component: stringcomponent}];
// Do not provide an icon with duplicate, different text to the menu item.
Expand Down Expand Up @@ -387,11 +385,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
if (action === 'hide') {
sectionElement.addClass('hidden');
replaceActionItem(actionItem, 'i/show',
'showfromothers', 'format_' + courseformat, null, null, 'show');
'showfromothers', 'format_' + courseformat, 'show');
} else {
sectionElement.removeClass('hidden');
replaceActionItem(actionItem, 'i/hide',
'hidefromothers', 'format_' + courseformat, null, null, 'hide');
'hidefromothers', 'format_' + courseformat, 'hide');
}
// Replace the modules with new html (that indicates that they are now hidden or not hidden).
if (data.modules !== undefined) {
Expand All @@ -408,14 +406,14 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
oldActionItem = oldmarker.find(SELECTOR.SECTIONACTIONMENU + ' ' + 'a[data-action=removemarker]');
oldmarker.removeClass('current');
replaceActionItem(oldActionItem, 'i/marker',
'highlight', 'core', 'markthistopic', 'core', 'setmarker');
'highlight', 'core', 'setmarker');
sectionElement.addClass('current');
replaceActionItem(actionItem, 'i/marked',
'highlightoff', 'core', 'markedthistopic', 'core', 'removemarker');
'highlightoff', 'core', 'removemarker');
} else if (action === 'removemarker') {
sectionElement.removeClass('current');
replaceActionItem(actionItem, 'i/marker',
'highlight', 'core', 'markthistopic', 'core', 'setmarker');
'highlight', 'core', 'setmarker');
}
};

Expand Down Expand Up @@ -610,19 +608,19 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
*
* This method can be used by course formats in their listener to the coursesectionedited event
*
* @deprecated since Moodle 3.9
* @param {JQuery} sectionelement
* @param {String} selector CSS selector inside the section element, for example "a[data-action=show]"
* @param {String} image new image name ("i/show", "i/hide", etc.)
* @param {String} stringname new string for the action menu item
* @param {String} stringcomponent
* @param {String} titlestr string for "title" attribute (if different from stringname)
* @param {String} titlecomponent
* @param {String} newaction new value for data-action attribute of the link
*/
replaceSectionActionItem: function(sectionelement, selector, image, stringname,
stringcomponent, titlestr, titlecomponent, newaction) {
stringcomponent, newaction) {
log.debug('replaceSectionActionItem() is deprecated and will be removed.');
var actionitem = sectionelement.find(SELECTOR.SECTIONACTIONMENU + ' ' + selector);
replaceActionItem(actionitem, image, stringname, stringcomponent, titlestr, titlecomponent, newaction);
replaceActionItem(actionitem, image, stringname, stringcomponent, newaction);
}
};
});

0 comments on commit f3c47c9

Please sign in to comment.