Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / examples / ux / Focus.js
index 3446c34..b57143c 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * Ext JS Library 3.0.0
+ * Ext JS Library 3.1.0
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -404,10 +404,10 @@ Ext.override(Ext.Container, {
     \r
     getFocusItems: function(){\r
         return this.items &&\r
-        this.items.filterBy(function(o){\r
-            return o.isFocusable;\r
-        }) ||\r
-        null;\r
+            this.items.filterBy(function(o){\r
+                return o.isFocusable;\r
+            }) ||\r
+            null;\r
     },\r
     \r
     getEnterItem: function(){\r
@@ -416,10 +416,9 @@ Ext.override(Ext.Container, {
         if (length === 1) {\r
             return ci.first().getEnterItem && ci.first().getEnterItem() || ci.first();\r
         }\r
-        else \r
-            if (length > 1) {\r
-                return ci.first();\r
-            }\r
+        else if (length > 1) {\r
+            return ci.first();\r
+        }\r
     },\r
     \r
     getNextFocus: function(current){\r
@@ -458,7 +457,7 @@ Ext.override(Ext.Panel, {
     getFocusItems: function(){\r
         // items gets all the items inside the body\r
         var items = Ext.Panel.superclass.getFocusItems.call(this), bodyFocus = null;\r
-        \r
+\r
         if (!items) {\r
             items = new Ext.util.MixedCollection();\r
             this.bodyFocus = this.bodyFocus || new Ext.a11y.FocusItem(this.body, this.enableTabbing);\r
@@ -608,8 +607,11 @@ Ext.override(Ext.Toolbar, {
         });\r
     },\r
     \r
-    addItem: function(item){\r
-        Ext.Toolbar.superclass.add.apply(this, arguments);\r
+    add: function(){\r
+        var item = Ext.Toolbar.superclass.add.apply(this, arguments);\r
+        if(!item || !item.events) {\r
+            return item;\r
+        }\r
         if (item.rendered && item.fi !== undefined) {\r
             item.fi.setRelayTo(this.el);\r
             this.relayEvents(item.fi, ['focus']);\r