var prevItem null createRecipeListItem function _item _i _isFirst if _

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var prevItem = null
$.createRecipeListItem = function(_item, _i, _isFirst) {
if (!_isFirst) {
prevItem = $.recipeInfoWrapper.getChildren()[0];
}
var nextItem = Ti.UI.createScrollView({
opacity: _isFirst ? 1 : 0,
height: Ti.UI.SIZE,
top: '0dp',
left: '10dp',
right: '10dp',
layout: 'vertical',
id: 'recipeInfo_MainWrapper_' + _item.id
});
$.drawRecipeItem(_item, _i, nextItem);
$.drawIngridientsList(_item, _i, nextItem);
$.recipeInfoWrapper.add(nextItem);
if (!_isFirst) {
prevItem.animate({
opacity: 0,
duration: 150
}, function () {
$.recipeInfoWrapper.remove(prevItem)
})
nextItem.animate({
opacity: 1,
duration: 150
});
}
};