Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created March 21, 2011 17:34
Show Gist options
  • Save eduardolundgren/879835 to your computer and use it in GitHub Desktop.
Save eduardolundgren/879835 to your computer and use it in GitHub Desktop.
extending aria plugin
instance.plug(A.Plugin.Aria, {
after: {
processAttribute: function(event) {
var instance = this;
var host = instance.get('host');
if (event.aria.attrName == 'collapsed') {
var collapsed = host.get('collapsed');
if (host.icons) {
var icons = host.icons;
var collapseItem = icons.item(COLLAPSE);
if (collapseItem) {
instance.setAttribute(
'aria-pressed',
collapsed,
collapseItem.get('boundingBox')
);
}
}
instance.setAttribute(
'aria-hidden',
collapsed,
host.bodyNode
);
event.halt(); // halting default setter
}
}
},
attributes: {
collapsed: 'aria-hidden'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment