Permalink
Browse files

MDL-30139 enrol: added search button to AJAX enrolment search

  • Loading branch information...
markn86 committed Nov 13, 2012
1 parent 8ccaa29 commit fe8a06dc74b6be5819c68b264c91589705aae6cc
@@ -64,7 +64,8 @@ Structure of the user enroller panel
.user-enroller-panel .uep-footer {padding:3px;background-color:#ddd;text-align:center;}
.user-enroller-panel .uep-search {margin:3px;}
.user-enroller-panel .uep-search label {padding-right:8px;}
-.user-enroller-panel .uep-search input {width:70%;}
+.user-enroller-panel .uep-search input {width:50%;}
+.user-enroller-panel .uep-search input.uep-search-btn {width:20%;}
.user-enroller-panel .uep-searchoptions {margin:3px;cursor:pointer;}
.user-enroller-panel .uep-searchoptions select {margin-left:1em;}
.user-enroller-panel .collapsibleheading img {margin-right:8px;}
@@ -5,6 +5,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
/** Properties **/
BASE : 'base',
SEARCH : 'search',
+ SEARCHBTN : 'searchbtn',
PARAMS : 'params',
URL : 'url',
AJAXURL : 'ajaxurl',
@@ -62,6 +63,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
DURATION : 'duration',
ACTIVE : 'active',
SEARCH : 'uep-search',
+ SEARCHBTN : 'uep-search-btn',
CLOSE : 'close',
CLOSEBTN : 'close-button'
};
@@ -109,8 +111,9 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
.setAttribute('src', M.util.image_url('i/loading', 'moodle')))
.setStyle('opacity', 0.5)))
.append(create('<div class="'+CSS.FOOTER+'"></div>')
- .append(create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol.usersearch+'</label></div>')
+ .append(create('<div class="'+CSS.SEARCH+'"><label for="enrolusersearch" class="accesshide">'+M.str.enrol.usersearch+'</label></div>')
.append(create('<input type="text" id="enrolusersearch" value="" />'))
+ .append(create('<input type="button" id="searchbtn" class="'+CSS.SEARCHBTN+'" value="'+M.str.enrol.usersearch+'" />'))
)
.append(create('<div class="'+CSS.CLOSEBTN+'"></div>')
.append(create('<input type="button" value="'+M.str.enrol.finishenrollingusers+'" />'))
@@ -120,6 +123,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
);
this.set(UEP.SEARCH, this.get(UEP.BASE).one('#enrolusersearch'));
+ this.set(UEP.SEARCHBTN, this.get(UEP.BASE).one('#searchbtn'));
Y.all('.enrol_manual_plugin input').each(function(node){
if (node.getAttribute('type', 'submit')) {
node.on('click', this.show, this);
@@ -133,6 +137,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
this.set(UEP.PARAMS, params);
Y.on('key', this.preSearch, this.get(UEP.SEARCH), 'down:13', this);
+ this.get(UEP.SEARCHBTN).on('click', this.preSearch, this);
Y.one(document.body).append(this.get(UEP.BASE));

0 comments on commit fe8a06d

Please sign in to comment.