git.ithinksw.org
/
extjs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git]
/
src
/
widgets
/
layout
/
CardLayout.js
diff --git
a/src/widgets/layout/CardLayout.js
b/src/widgets/layout/CardLayout.js
index
1da6130
..
c657f77
100644
(file)
--- a/
src/widgets/layout/CardLayout.js
+++ b/
src/widgets/layout/CardLayout.js
@@
-1,6
+1,6
@@
/*!
/*!
- * Ext JS Library 3.1.
0
- * Copyright(c) 2006-20
09
Ext JS, LLC
+ * Ext JS Library 3.1.
1
+ * Copyright(c) 2006-20
10
Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
* licensing@extjs.com
* http://www.extjs.com/license
*/
@@
-78,7
+78,7
@@
Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
* true might improve performance.
\r
*/
\r
deferredRender : false,
\r
* true might improve performance.
\r
*/
\r
deferredRender : false,
\r
-
\r
+
\r
/**
\r
* @cfg {Boolean} layoutOnCardChange
\r
* True to force a layout of the active item when the active card is changed. Defaults to false.
\r
/**
\r
* @cfg {Boolean} layoutOnCardChange
\r
* True to force a layout of the active item when the active card is changed. Defaults to false.
\r
@@
-90,10
+90,11
@@
Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
*/
\r
// private
\r
renderHidden : true,
\r
*/
\r
// private
\r
renderHidden : true,
\r
-
\r
+
\r
+ type: 'card',
\r
+
\r
constructor: function(config){
\r
Ext.layout.CardLayout.superclass.constructor.call(this, config);
\r
constructor: function(config){
\r
Ext.layout.CardLayout.superclass.constructor.call(this, config);
\r
- // this.forceLayout = (this.deferredRender === false);
\r
},
\r
\r
/**
\r
},
\r
\r
/**
\r
@@
-101,20
+102,34
@@
Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
* @param {String/Number} item The string component id or numeric index of the item to activate
\r
*/
\r
setActiveItem : function(item){
\r
* @param {String/Number} item The string component id or numeric index of the item to activate
\r
*/
\r
setActiveItem : function(item){
\r
- var ai = this.activeItem;
\r
- item = this.container.getComponent(item);
\r
- if(ai != item){
\r
+ var ai = this.activeItem,
\r
+ ct = this.container;
\r
+ item = ct.getComponent(item);
\r
+
\r
+ // Is this a valid, different card?
\r
+ if(item && ai != item){
\r
+
\r
+ // Changing cards, hide the current one
\r
if(ai){
\r
ai.hide();
\r
if(ai){
\r
ai.hide();
\r
+ if (ai.hidden !== true) {
\r
+ return false;
\r
+ }
\r
ai.fireEvent('deactivate', ai);
\r
}
\r
ai.fireEvent('deactivate', ai);
\r
}
\r
- var layout = item.doLayout && (this.layoutOnCardChange || !item.rendered);
\r
+ // Change activeItem reference
\r
this.activeItem = item;
\r
this.activeItem = item;
\r
- if(item){
\r
- item.show();
\r
- }
\r
+
\r
+ // The container is about to get a recursive layout, remove any deferLayout reference
\r
+ // because it will trigger a redundant layout.
\r
+ delete item.deferLayout;
\r
+
\r
+ // Show the new component
\r
+ item.show();
\r
+
\r
this.layout();
\r
this.layout();
\r
- if(item && layout){
\r
+
\r
+ if(item.doLayout){
\r
item.doLayout();
\r
}
\r
item.fireEvent('activate', item);
\r
item.doLayout();
\r
}
\r
item.fireEvent('activate', item);
\r