mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
enhance(slideBox): re-add update() method
This commit is contained in:
12
js/angular/directive/slide.js
vendored
12
js/angular/directive/slide.js
vendored
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user