MDL-59499 - Fixed collapsing category javascript to use template rendering
This commit is contained in:
committed by
David Monllao
parent
87d1c6134f
commit
d040476723
+7
-3
@@ -1377,10 +1377,14 @@ Category.prototype = {
|
||||
node.addClass('collapsed').setAttribute('aria-expanded', 'false');
|
||||
action.setAttribute('data-action', 'expand').setAttrs({
|
||||
title: M.util.get_string('expandcategory', 'moodle', this.getName())
|
||||
}).one('img').setAttrs({
|
||||
src: M.util.image_url('t/switch_plus', 'moodle'),
|
||||
alt: M.util.get_string('expand', 'moodle')
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
ul.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1350,10 +1350,14 @@ Category.prototype = {
|
||||
node.addClass('collapsed').setAttribute('aria-expanded', 'false');
|
||||
action.setAttribute('data-action', 'expand').setAttrs({
|
||||
title: M.util.get_string('expandcategory', 'moodle', this.getName())
|
||||
}).one('img').setAttrs({
|
||||
src: M.util.image_url('t/switch_plus', 'moodle'),
|
||||
alt: M.util.get_string('expand', 'moodle')
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
ul.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
+7
-3
@@ -194,10 +194,14 @@ Category.prototype = {
|
||||
node.addClass('collapsed').setAttribute('aria-expanded', 'false');
|
||||
action.setAttribute('data-action', 'expand').setAttrs({
|
||||
title: M.util.get_string('expandcategory', 'moodle', this.getName())
|
||||
}).one('img').setAttrs({
|
||||
src: M.util.image_url('t/switch_plus', 'moodle'),
|
||||
alt: M.util.get_string('expand', 'moodle')
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
if (ul) {
|
||||
ul.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user