linuxwindowsinboxwhatsappicloudtweetdeckhipchattelegramhangoutsslackgmailskypefacebook-workplaceoutlookemailmicrosoft-teamsdiscordmessengercustom-servicesmacos
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
998 B
44 lines
998 B
9 years ago
|
/** */
|
||
|
Ext.define('Ext.aria.tab.Panel', {
|
||
|
override: 'Ext.tab.Panel',
|
||
|
|
||
|
requires: [
|
||
|
'Ext.layout.container.Card',
|
||
|
'Ext.aria.tab.Bar'
|
||
|
],
|
||
|
|
||
|
isTabPanel: true,
|
||
|
|
||
|
onAdd: function(item, index) {
|
||
|
item.ariaRole = 'tabpanel';
|
||
|
|
||
|
this.callParent(arguments);
|
||
|
},
|
||
|
|
||
|
setActiveTab: function(card) {
|
||
|
var me = this,
|
||
|
items, item, isActive, i, len;
|
||
|
|
||
|
me.callParent(arguments);
|
||
|
|
||
|
items = me.getRefItems();
|
||
|
|
||
|
for (i = 0, len = items.length; i < len; i++) {
|
||
|
item = items[i];
|
||
|
|
||
|
if (item.ariaRole === 'tabpanel') {
|
||
|
isActive = item === card;
|
||
|
|
||
|
item.ariaUpdate({
|
||
|
'aria-expanded': isActive,
|
||
|
'aria-hidden': !isActive
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
ariaIsOwnTab: function(cmp) {
|
||
|
return cmp.isTab && cmp.isGroupedBy.ownerCt === this;
|
||
|
}
|
||
|
});
|