mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
collectionRepeat: only digest if available
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user