From 57e8a9361f6206ddc66c20e154326df9c3d218e4 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Tue, 20 Jul 2010 03:56:22 +0000 Subject: [PATCH] enrol MDL-23384 fixed issue with cohort sync JavaScript not redirecting after successfully enrolling a cohort --- .../quickcohortenrolment/quickcohortenrolment.js | 15 +++++++++------ theme/base/style/core.css | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/enrol/yui/quickcohortenrolment/quickcohortenrolment.js b/enrol/yui/quickcohortenrolment/quickcohortenrolment.js index 865f33e5c1a..aa55f3bbe1e 100644 --- a/enrol/yui/quickcohortenrolment/quickcohortenrolment.js +++ b/enrol/yui/quickcohortenrolment/quickcohortenrolment.js @@ -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('
').append(Y.Node.create('loading').setAttribute('src', M.cfg.loadingicon)).setStyle('opacity', 0.5)); }, panel); @@ -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('
') + .setStyle('height', Y.one(document.body).get('docHeight')+'px') + .setStyle('opacity', '0.4') + .append(Y.Node.create('loading').setAttribute('src', M.cfg.loadingicon))); + window.location.href = redirecturl; } } if (result.response && result.response.message) { diff --git a/theme/base/style/core.css b/theme/base/style/core.css index 46b8e7ab7c8..b0e2a38aa34 100644 --- a/theme/base/style/core.css +++ b/theme/base/style/core.css @@ -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%;} \ No newline at end of file