Skip to content
Browse files

Make slide transition switch left/right.

Instead of hooking into the beforecardswitch event (which wasn't working
anyway), pass the animation info as a 2nd parameter to the
setActiveItem() function call.
  • Loading branch information...
1 parent 71758fa commit 130278e2630cd132a832637d29e7bd93616ada76 @nelstrom committed Jan 17, 2011
Showing with 3 additions and 11 deletions.
  1. +3 −11 public/javascripts/index.js
View
14 public/javascripts/index.js
@@ -7,7 +7,7 @@ ListDemo = new Ext.Application({
id: 'disclosurelist',
onItemDisclosure: function(record, btn, index) {
ListDemo.detailPanel.update(record.data);
- ListDemo.Viewport.setActiveItem('detailpanel');
+ ListDemo.Viewport.setActiveItem('detailpanel', {type:'slide',direction:'left'});
},
store: ListDemo.ListStore,
itemTpl: '<div class="contact">{firstName} {lastName}</div>'
@@ -23,7 +23,7 @@ ListDemo = new Ext.Application({
text: 'back',
ui: 'back',
handler: function() {
- ListDemo.Viewport.setActiveItem('disclosurelist');
+ ListDemo.Viewport.setActiveItem('disclosurelist', {type:'slide', direction:'right'});
}
}]
}
@@ -34,15 +34,7 @@ ListDemo = new Ext.Application({
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
- items: [ListDemo.disclosureList, ListDemo.detailPanel],
- beforecardswitch: function(newCard, oldCard, index, animated) {
- if (index === 1) {
- ListDemo.Viewport.cardSwitchAnimation.direction = 'right';
- } else {
- ListDemo.Viewport.cardSwitchAnimation.direction = 'left';
- }
- return true;
- }
+ items: [ListDemo.disclosureList, ListDemo.detailPanel]
});
}
});

0 comments on commit 130278e

Please sign in to comment.
Something went wrong with that request. Please try again.