enrol MDL-23384 fixed issue with cohort sync JavaScript not redirecting after success...
authorSam Hemelryk <sam@moodle.com>
Tue, 20 Jul 2010 03:56:22 +0000 (03:56 +0000)
committerSam Hemelryk <sam@moodle.com>
Tue, 20 Jul 2010 03:56:22 +0000 (03:56 +0000)
enrol/yui/quickcohortenrolment/quickcohortenrolment.js
theme/base/style/core.css

index 865f33e..aa55f3b 100644 (file)
@@ -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);
@@ -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) {
index 46b8e7a..b0e2a38 100644 (file)
@@ -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