/*!
- * Ext JS Library 3.1.1
- * Copyright(c) 2006-2010 Ext JS, LLC
+ * Ext JS Library 3.2.0
+ * Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
-(function() {\r
-\r
-Ext.a11y.ARIA = Ext.apply(new Ext.util.Observable(), function() {\r
- return {\r
- setRole : function(el, role) {\r
- el = Ext.getDom(el);\r
- if(el) {\r
- el.setAttribute('role', role.toString());\r
- }\r
- },\r
- \r
- setProperty : function(el, key, value) {\r
- el = Ext.getDom(el);\r
- if(el) {\r
- el.setAttribute(key.toString(), value.toString());\r
- } \r
- }\r
- }\r
-}());\r
-\r
-var ARIA = Ext.a11y.ARIA;\r
-\r
-Ext.override(Ext.tree.TreeNode, {\r
- render : function(bulkRender){\r
- this.ui.render(bulkRender);\r
- if(!this.rendered){\r
- // make sure it is registered\r
- this.getOwnerTree().registerNode(this);\r
- this.rendered = true;\r
- this.fireEvent('noderender', this);\r
- if(this.expanded){\r
- this.expanded = false;\r
- this.expand(false, false);\r
- }\r
- }\r
- }\r
-});\r
-\r
-Ext.override(Ext.tree.TreePanel, {\r
- initARIA : function() {\r
- Ext.tree.TreePanel.superclass.initARIA.call(this);\r
- this.getSelectionModel().on('selectionchange', this.onNodeSelect, this);\r
- this.ariaTreeEl = this.body.down('.x-tree-root-ct');\r
- this.on('collapsenode', this.onNodeCollapse, this);\r
- this.on('expandnode', this.onNodeExpand, this);\r
- },\r
- \r
- // private\r
- registerNode : function(node){\r
- if(this.nodeHash[node.id] === undefined) {\r
- node.on('noderender', this.onNodeRender, this);\r
- }\r
- this.nodeHash[node.id] = node;\r
- },\r
-\r
- // private\r
- unregisterNode : function(node){\r
- node.un('noderender', this.onNodeRender, this);\r
- delete this.nodeHash[node.id];\r
- },\r
- \r
- onNodeRender : function(node) {\r
- var a = node.ui.anchor,\r
- level = this.rootVisible ? 1 : 0,\r
- pnode = node;\r
- \r
- if(node.isRoot) {\r
- ARIA.setRole(this.ariaTreeEl, 'tree');\r
- ARIA.setProperty(this.ariaTreeEl, 'aria-labelledby', Ext.id(node.ui.textNode));\r
- ARIA.setProperty(this.ariaTreeEl, 'aria-activedescendant', 'false');\r
- if(!this.rootVisible) {\r
- return;\r
- }\r
- }\r
- ARIA.setRole(node.ui.wrap, 'treeitem');\r
- ARIA.setProperty(node.ui.wrap, 'aria-labelledby', Ext.id(node.ui.textNode)); \r
- ARIA.setProperty(node.ui.wrap, 'aria-expanded', 'false');\r
- ARIA.setProperty(node.ui.wrap, 'aria-selected', 'false');\r
- while (pnode.parentNode) {\r
- level++;\r
- pnode = pnode.parentNode;\r
- }\r
- ARIA.setProperty(node.ui.wrap, 'aria-level', level); \r
- if(!node.isLeaf()) {\r
- ARIA.setRole(node.ui.ctNode, 'group');\r
- ARIA.setProperty(node.ui.wrap, 'aria-expanded', node.isExpanded());\r
- }\r
- },\r
- \r
- onNodeSelect : function(sm, node) {\r
- ARIA.setProperty(this.ariaTreeEl, 'aria-activedescendant', Ext.id(node.ui.wrap));\r
- ARIA.setProperty(node.ui.wrap, 'aria-selected', 'true');\r
- },\r
- \r
- onNodeCollapse : function(node) {\r
- ARIA.setProperty(node.ui.wrap, 'aria-expanded', 'false');\r
- },\r
- \r
- onNodeExpand : function(node) {\r
- ARIA.setProperty(node.ui.wrap, 'aria-expanded', 'true');\r
- }\r
-});\r
- \r
+(function() {
+
+Ext.a11y.ARIA = Ext.apply(new Ext.util.Observable(), function() {
+ return {
+ setRole : function(el, role) {
+ el = Ext.getDom(el);
+ if(el) {
+ el.setAttribute('role', role.toString());
+ }
+ },
+
+ setProperty : function(el, key, value) {
+ el = Ext.getDom(el);
+ if(el) {
+ el.setAttribute(key.toString(), value.toString());
+ }
+ }
+ }
+}());
+
+var ARIA = Ext.a11y.ARIA;
+
+Ext.override(Ext.tree.TreeNode, {
+ render : function(bulkRender){
+ this.ui.render(bulkRender);
+ if(!this.rendered){
+ // make sure it is registered
+ this.getOwnerTree().registerNode(this);
+ this.rendered = true;
+ this.fireEvent('noderender', this);
+ if(this.expanded){
+ this.expanded = false;
+ this.expand(false, false);
+ }
+ }
+ }
+});
+
+Ext.override(Ext.tree.TreePanel, {
+ initARIA : function() {
+ Ext.tree.TreePanel.superclass.initARIA.call(this);
+ this.getSelectionModel().on('selectionchange', this.onNodeSelect, this);
+ this.ariaTreeEl = this.body.down('.x-tree-root-ct');
+ this.on('collapsenode', this.onNodeCollapse, this);
+ this.on('expandnode', this.onNodeExpand, this);
+ },
+
+ // private
+ registerNode : function(node){
+ if(this.nodeHash[node.id] === undefined) {
+ node.on('noderender', this.onNodeRender, this);
+ }
+ this.nodeHash[node.id] = node;
+ },
+
+ // private
+ unregisterNode : function(node){
+ node.un('noderender', this.onNodeRender, this);
+ delete this.nodeHash[node.id];
+ },
+
+ onNodeRender : function(node) {
+ var a = node.ui.anchor,
+ level = this.rootVisible ? 1 : 0,
+ pnode = node;
+
+ if(node.isRoot) {
+ ARIA.setRole(this.ariaTreeEl, 'tree');
+ ARIA.setProperty(this.ariaTreeEl, 'aria-labelledby', Ext.id(node.ui.textNode));
+ ARIA.setProperty(this.ariaTreeEl, 'aria-activedescendant', 'false');
+ if(!this.rootVisible) {
+ return;
+ }
+ }
+ ARIA.setRole(node.ui.wrap, 'treeitem');
+ ARIA.setProperty(node.ui.wrap, 'aria-labelledby', Ext.id(node.ui.textNode));
+ ARIA.setProperty(node.ui.wrap, 'aria-expanded', 'false');
+ ARIA.setProperty(node.ui.wrap, 'aria-selected', 'false');
+ while (pnode.parentNode) {
+ level++;
+ pnode = pnode.parentNode;
+ }
+ ARIA.setProperty(node.ui.wrap, 'aria-level', level);
+ if(!node.isLeaf()) {
+ ARIA.setRole(node.ui.ctNode, 'group');
+ ARIA.setProperty(node.ui.wrap, 'aria-expanded', node.isExpanded());
+ }
+ },
+
+ onNodeSelect : function(sm, node) {
+ ARIA.setProperty(this.ariaTreeEl, 'aria-activedescendant', Ext.id(node.ui.wrap));
+ ARIA.setProperty(node.ui.wrap, 'aria-selected', 'true');
+ },
+
+ onNodeCollapse : function(node) {
+ ARIA.setProperty(node.ui.wrap, 'aria-expanded', 'false');
+ },
+
+ onNodeExpand : function(node) {
+ ARIA.setProperty(node.ui.wrap, 'aria-expanded', 'true');
+ }
+});
+
})();
\ No newline at end of file