Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / src / widgets / CycleButton.js
index 2766310..a57bdfd 100644 (file)
@@ -1,6 +1,6 @@
 /*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
@@ -97,7 +97,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
             }\r
             this.activeItem = item;\r
             if(!item.checked){\r
-                item.setChecked(true, true);\r
+                item.setChecked(true, false);\r
             }\r
             if(this.forceIcon){\r
                 this.setIconClass(this.forceIcon);\r
@@ -138,7 +138,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
         this.itemCount = this.items.length;\r
 \r
         this.menu = {cls:'x-cycle-menu', items:[]};\r
-        var checked;\r
+        var checked = 0;\r
         Ext.each(this.items, function(item, i){\r
             Ext.apply(item, {\r
                 group: item.group || this.id,\r
@@ -149,13 +149,12 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
             });\r
             this.menu.items.push(item);\r
             if(item.checked){\r
-                checked = item;\r
+                checked = i;\r
             }\r
         }, this);\r
-        this.setActiveItem(checked, true);\r
         Ext.CycleButton.superclass.initComponent.call(this);\r
-\r
         this.on('click', this.toggleSelected, this);\r
+        this.setActiveItem(checked, true);\r
     },\r
 \r
     // private\r