Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-33448 enrol_manual: Reordered things to improve JS performance wh…

…en enrolling users

Conflicts:

	enrol/manual/yui/quickenrolment/quickenrolment.js
  • Loading branch information...
commit 44e094d1ec97950c546b3f503ee1fd7e9c02b454 1 parent 15b3a43
@samhemelryk samhemelryk authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 enrol/manual/yui/quickenrolment/quickenrolment.js
View
8 enrol/manual/yui/quickenrolment/quickenrolment.js
@@ -141,6 +141,11 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
base.one('.'+CSS.HEADER+' h2').setStyle('cursor', 'move');
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
+ this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).once('click', function() {
+ // We want to do this just once, the first time the controls are shown.
+ this.populateStartDates();
+ this.populateDuration();
+ }, this);
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).on('click', function(){
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).toggleClass(CSS.ACTIVE);
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).toggleClass(CSS.HIDDEN);
@@ -150,10 +155,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/expanded', 'moodle'));
}
}, this);
-
this.populateAssignableRoles();
- this.populateStartDates();
- this.populateDuration();
},
populateAssignableRoles : function() {
this.on('assignablerolesloaded', function(){
Please sign in to comment.
Something went wrong with that request. Please try again.