mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-59499 coursemanagement: Rewitten expand and collapse
Also replace M.util.get_string() calls with core/str module
This commit is contained in:
parent
d040476723
commit
9c631e9408
@ -1354,10 +1354,14 @@ Category.prototype = {
|
||||
title: M.util.get_string('collapsecategory', 'moodle', this.getName())
|
||||
});
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix('t/switch_minus', 'core', M.util.get_string('collapse', 'moodle')).then(function(html) {
|
||||
action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
require(['core/str', 'core/templates', 'core/notification'], function(Str, Templates, Notification) {
|
||||
Str.get_string('collapse', 'core')
|
||||
.then(function(string) {
|
||||
return Templates.renderPix('t/switch_minus', 'core', string);
|
||||
})
|
||||
.then(function(html) {
|
||||
return action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
@ -1379,10 +1383,14 @@ Category.prototype = {
|
||||
title: M.util.get_string('expandcategory', 'moodle', this.getName())
|
||||
});
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix('t/switch_plus', 'core', M.util.get_string('expand', 'moodle')).then(function(html) {
|
||||
action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
require(['core/str', 'core/templates', 'core/notification'], function(Str, Templates, Notification) {
|
||||
Str.get_string('expand', 'core')
|
||||
.then(function(string) {
|
||||
return Templates.renderPix('t/switch_plus', 'core', string);
|
||||
})
|
||||
.then(function(html) {
|
||||
return action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1327,10 +1327,14 @@ Category.prototype = {
|
||||
title: M.util.get_string('collapsecategory', 'moodle', this.getName())
|
||||
});
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix('t/switch_minus', 'core', M.util.get_string('collapse', 'moodle')).then(function(html) {
|
||||
action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
require(['core/str', 'core/templates', 'core/notification'], function(Str, Templates, Notification) {
|
||||
Str.get_string('collapse', 'core')
|
||||
.then(function(string) {
|
||||
return Templates.renderPix('t/switch_minus', 'core', string);
|
||||
})
|
||||
.then(function(html) {
|
||||
return action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
@ -1352,10 +1356,14 @@ Category.prototype = {
|
||||
title: M.util.get_string('expandcategory', 'moodle', this.getName())
|
||||
});
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix('t/switch_plus', 'core', M.util.get_string('expand', 'moodle')).then(function(html) {
|
||||
action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
require(['core/str', 'core/templates', 'core/notification'], function(Str, Templates, Notification) {
|
||||
Str.get_string('expand', 'core')
|
||||
.then(function(string) {
|
||||
return Templates.renderPix('t/switch_plus', 'core', string);
|
||||
})
|
||||
.then(function(html) {
|
||||
return action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
|
24
course/yui/src/management/js/category.js
vendored
24
course/yui/src/management/js/category.js
vendored
@ -171,10 +171,14 @@ Category.prototype = {
|
||||
title: M.util.get_string('collapsecategory', 'moodle', this.getName())
|
||||
});
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix('t/switch_minus', 'core', M.util.get_string('collapse', 'moodle')).then(function(html) {
|
||||
action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
require(['core/str', 'core/templates', 'core/notification'], function(Str, Templates, Notification) {
|
||||
Str.get_string('collapse', 'core')
|
||||
.then(function(string) {
|
||||
return Templates.renderPix('t/switch_minus', 'core', string);
|
||||
})
|
||||
.then(function(html) {
|
||||
return action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
@ -196,10 +200,14 @@ Category.prototype = {
|
||||
title: M.util.get_string('expandcategory', 'moodle', this.getName())
|
||||
});
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix('t/switch_plus', 'core', M.util.get_string('expand', 'moodle')).then(function(html) {
|
||||
action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
require(['core/str', 'core/templates', 'core/notification'], function(Str, Templates, Notification) {
|
||||
Str.get_string('expand', 'core')
|
||||
.then(function(string) {
|
||||
return Templates.renderPix('t/switch_plus', 'core', string);
|
||||
})
|
||||
.then(function(html) {
|
||||
return action.set('innerHTML', html);
|
||||
}).fail(Notification.exception);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user