MDL-52849 core: Focus reader onto popup with ajax errors

This commit is contained in:
Peter 2019-07-25 12:01:42 +08:00 committed by Peter
parent 8e9e9a5f7e
commit d439fac53c
7 changed files with 11 additions and 8 deletions

View File

@ -63,7 +63,8 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
labelsep = M.util.get_string('labelsep', 'langconfig');
this.get(BASE).addClass('moodle-dialogue-exception');
this.setStdModContent(Y.WidgetStdMod.HEADER,
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + Y.Escape.html(config.name) + '</h1>',
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">'
+ Y.Escape.html(config.name) + '</h1>',
Y.WidgetStdMod.REPLACE);
content = Y.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>')
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('error')) + '</div>'))

View File

@ -63,7 +63,8 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
labelsep = M.util.get_string('labelsep', 'langconfig');
this.get(BASE).addClass('moodle-dialogue-exception');
this.setStdModContent(Y.WidgetStdMod.HEADER,
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + Y.Escape.html(config.name) + '</h1>',
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">'
+ Y.Escape.html(config.name) + '</h1>',
Y.WidgetStdMod.REPLACE);
content = Y.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>')
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('error')) + '</div>'))

View File

@ -67,7 +67,7 @@ DIALOGUE = function(config) {
config.notificationBase =
Y.Node.create('<div class="' + CSS.BASE + '">')
.append(Y.Node.create('<div id="' + id + '" role="dialog" ' +
'aria-labelledby="' + id + '-header-text" class="' + CSS.WRAP + '"></div>')
'aria-labelledby="' + id + '-header-text" class="' + CSS.WRAP + '" aria-live="polite"></div>')
.append(Y.Node.create('<div id="' + id + '-header-text" class="' + CSS.HEADER + ' yui3-widget-hd"></div>'))
.append(Y.Node.create('<div class="' + CSS.BODY + ' yui3-widget-bd"></div>'))
.append(Y.Node.create('<div class="' + CSS.FOOTER + ' yui3-widget-ft"></div>')));

File diff suppressed because one or more lines are too long

View File

@ -67,7 +67,7 @@ DIALOGUE = function(config) {
config.notificationBase =
Y.Node.create('<div class="' + CSS.BASE + '">')
.append(Y.Node.create('<div id="' + id + '" role="dialog" ' +
'aria-labelledby="' + id + '-header-text" class="' + CSS.WRAP + '"></div>')
'aria-labelledby="' + id + '-header-text" class="' + CSS.WRAP + '" aria-live="polite"></div>')
.append(Y.Node.create('<div id="' + id + '-header-text" class="' + CSS.HEADER + ' yui3-widget-hd"></div>'))
.append(Y.Node.create('<div class="' + CSS.BODY + ' yui3-widget-bd"></div>'))
.append(Y.Node.create('<div class="' + CSS.FOOTER + ' yui3-widget-ft"></div>')));

View File

@ -33,7 +33,8 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
labelsep = M.util.get_string('labelsep', 'langconfig');
this.get(BASE).addClass('moodle-dialogue-exception');
this.setStdModContent(Y.WidgetStdMod.HEADER,
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + Y.Escape.html(config.name) + '</h1>',
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">'
+ Y.Escape.html(config.name) + '</h1>',
Y.WidgetStdMod.REPLACE);
content = Y.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>')
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('error')) + '</div>'))

View File

@ -37,7 +37,7 @@ DIALOGUE = function(config) {
config.notificationBase =
Y.Node.create('<div class="' + CSS.BASE + '">')
.append(Y.Node.create('<div id="' + id + '" role="dialog" ' +
'aria-labelledby="' + id + '-header-text" class="' + CSS.WRAP + '"></div>')
'aria-labelledby="' + id + '-header-text" class="' + CSS.WRAP + '" aria-live="polite"></div>')
.append(Y.Node.create('<div id="' + id + '-header-text" class="' + CSS.HEADER + ' yui3-widget-hd"></div>'))
.append(Y.Node.create('<div class="' + CSS.BODY + ' yui3-widget-bd"></div>'))
.append(Y.Node.create('<div class="' + CSS.FOOTER + ' yui3-widget-ft"></div>')));