enhance(slideBox): re-add update() method

This commit is contained in:
Andrew
2014-10-09 09:50:30 -06:00
parent 01c829c351
commit d9cc7894d5
6 changed files with 41 additions and 36 deletions

View File

@@ -38,18 +38,6 @@ IonicModule
slideBoxCtrl.remove(slideCtrl);
});
element.one('$animate:after', watchNgRepeatIndexOnInsertElement);
element.on('$animate:after', refreshStateOnInsertElement);
// If this element is inserted later by an ng-if or ng-repeat, remove it
// from the DOM again if it's irrelevant (not selected or adjacent).
function refreshStateOnInsertElement() {
var slideIndex = slideBoxCtrl.indexOf(slideCtrl);
if (!slideBoxCtrl.isRelevant(slideIndex)) {
slideCtrl.setState('detached');
}
}
// Move with ng-repeat if this slide is part of ng-repeat.
// scope.$index only appears after the first time ng-repaet inserts the element.
function watchNgRepeatIndexOnInsertElement() {