Skip to content

Commit

Permalink
collectionRepeat: only digest if available
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Apr 29, 2014
1 parent a467418 commit 431449f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions demos/collection-repeat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

<title>Collection-Repeat: Early Preview</title>

<link href="http://code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="http://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<link href="../../dist/css/ionic.css" rel="stylesheet">
<script src="../../dist/js/ionic.bundle.js"></script>
<link href="style.css" rel="stylesheet">
<script src="script.js"></script>
<script src="contacts.js"></script>
Expand Down
8 changes: 3 additions & 5 deletions js/angular/service/collectionRepeatManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ function($rootScope, $timeout) {

this.setCurrentIndex(startIndex);
this.lastRenderScrollValue = startPos;

// if (!this.dataSource.scope.$$phase) {
// this.dataSource.scope.$digest();
// }
},
renderItem: function(dataIndex, primaryPos, secondaryPos) {
var item = this.dataSource.getItem(dataIndex);
Expand All @@ -211,7 +207,9 @@ function($rootScope, $timeout) {
primaryPos, secondaryPos, secondaryPos
);
this.renderedItems[dataIndex] = item;
item.scope.$digest();
if (!item.scope.$$phase) {
item.scope.$digest();
}
} else {
delete this.renderedItems[dataIndex];
}
Expand Down

0 comments on commit 431449f

Please sign in to comment.