MDL-38661 JavaScript: Ensure that ARIA tags are set when expanding/collapsing content
This commit is contained in:
+2
@@ -237,11 +237,13 @@ NS.run_expansion = function(categorynode) {
|
||||
// To avoid a jump effect, we need to set the height of the children to 0 here before removing the SECTIONCOLLAPSED class.
|
||||
categorychildren.setStyle('height', '0');
|
||||
categorynode.removeClass(CSS.SECTIONCOLLAPSED);
|
||||
categorynode.setAttribute('aria-expanded', 'true');
|
||||
categorychildren.fx.set('reverse', false);
|
||||
} else {
|
||||
categorychildren.fx.set('reverse', true);
|
||||
categorychildren.fx.once('end', function(e, categorynode) {
|
||||
categorynode.addClass(CSS.SECTIONCOLLAPSED);
|
||||
categorynode.setAttribute('aria-expanded', 'false');
|
||||
}, this, categorynode);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+2
@@ -236,11 +236,13 @@ NS.run_expansion = function(categorynode) {
|
||||
// To avoid a jump effect, we need to set the height of the children to 0 here before removing the SECTIONCOLLAPSED class.
|
||||
categorychildren.setStyle('height', '0');
|
||||
categorynode.removeClass(CSS.SECTIONCOLLAPSED);
|
||||
categorynode.setAttribute('aria-expanded', 'true');
|
||||
categorychildren.fx.set('reverse', false);
|
||||
} else {
|
||||
categorychildren.fx.set('reverse', true);
|
||||
categorychildren.fx.once('end', function(e, categorynode) {
|
||||
categorynode.addClass(CSS.SECTIONCOLLAPSED);
|
||||
categorynode.setAttribute('aria-expanded', 'false');
|
||||
}, this, categorynode);
|
||||
}
|
||||
|
||||
|
||||
@@ -235,11 +235,13 @@ NS.run_expansion = function(categorynode) {
|
||||
// To avoid a jump effect, we need to set the height of the children to 0 here before removing the SECTIONCOLLAPSED class.
|
||||
categorychildren.setStyle('height', '0');
|
||||
categorynode.removeClass(CSS.SECTIONCOLLAPSED);
|
||||
categorynode.setAttribute('aria-expanded', 'true');
|
||||
categorychildren.fx.set('reverse', false);
|
||||
} else {
|
||||
categorychildren.fx.set('reverse', true);
|
||||
categorychildren.fx.once('end', function(e, categorynode) {
|
||||
categorynode.addClass(CSS.SECTIONCOLLAPSED);
|
||||
categorynode.setAttribute('aria-expanded', 'false');
|
||||
}, this, categorynode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user