Skip to content

Commit

Permalink
MDL-33448 enrol_manual: Reduced JS get_string calls for the yui widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Dec 2, 2012
1 parent 44e094d commit 0ae2507
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enrol/manual/yui/quickenrolment/quickenrolment.js
Expand Up @@ -194,9 +194,10 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
var select = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.DURATION+' select');
var defaultvalue = this.get(UEP.DEFAULTDURATION);
var index = 0, count = 0;
var durationdays = M.util.get_string('durationdays', 'enrol', '{a}');
for (var i = 1; i <= 365; i++) {
count++;
var option = create('<option value="'+i+'">'+M.util.get_string('durationdays', 'enrol', i)+'</option>');
var option = create('<option value="'+i+'">'+durationdays.replace('{a}', i)+'</option>');
if (i == defaultvalue) {
index = count;
}
Expand Down

0 comments on commit 0ae2507

Please sign in to comment.