Skip to content

Commit

Permalink
enrol MDL-23384 fixed issue with cohort sync JavaScript not redirecti…
Browse files Browse the repository at this point in the history
…ng after successfully enrolling a cohort
  • Loading branch information
Sam Hemelryk committed Jul 20, 2010
1 parent 690aa22 commit 57e8a93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions enrol/yui/quickcohortenrolment/quickcohortenrolment.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ YUI.add('moodle-enrol-quickcohortenrolment', function(Y) {
this.set('centered', true);
this.show();
}, panel);
this.on('hide', function() {
this.hide();
}, panel);
this.on('hide', panel.hide, panel);
this.on('performingaction', function(){
this.get('boundingBox').append(Y.Node.create('<div class="performing-action"></div>').append(Y.Node.create('<img alt="loading" />').setAttribute('src', M.cfg.loadingicon)).setStyle('opacity', 0.5));
}, panel);
Expand Down Expand Up @@ -198,9 +196,14 @@ YUI.add('moodle-enrol-quickcohortenrolment', function(Y) {
if (result.error) {
new M.core.ajaxException(result);
} else {
var redirect = function() {
if (result.response.users) {
window.location.href = this.get(URL);
var redirecturl = this.get(URL), redirect = function() {
if (!usersonly || result.response.users) {
Y.one(document.body).append(
Y.Node.create('<div class="corelightbox"></div>')
.setStyle('height', Y.one(document.body).get('docHeight')+'px')
.setStyle('opacity', '0.4')
.append(Y.Node.create('<img alt="loading" />').setAttribute('src', M.cfg.loadingicon)));
window.location.href = redirecturl;
}
}
if (result.response && result.response.message) {
Expand Down
3 changes: 3 additions & 0 deletions theme/base/style/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,6 @@ body.tag .managelink {padding: 5px;}
.dir-rtl .mform .fitem .fitemtitle {float:right;}
.dir-rtl .loginbox .loginform .form-label {float:right;text-align:left;}
.dir-rtl .loginbox .loginform .form-input {text-align: right;}

.corelightbox {background-color:#CCC;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;}
.corelightbox img {position:fixed;top:50%;}

0 comments on commit 57e8a93

Please sign in to comment.