mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(slideBox): work w/ parent scope disconnect
This commit is contained in:
6
js/angular/controller/slideBoxController.js
vendored
6
js/angular/controller/slideBoxController.js
vendored
@@ -322,7 +322,7 @@ function(scope, element, $log, $document, $$q, $timeout, $interval, $$ionicAttac
|
||||
function setDisplay(slide, display) {
|
||||
if (!slide) return;
|
||||
var slideScope = jqLite(slide).data('$ionSlideScope');
|
||||
if (slideScope) {
|
||||
if (slideScope && !ionic.Utils.isScopeDisconnected(scope)) {
|
||||
ionic.Utils.reconnectScope(slideScope);
|
||||
// Digest the slide so it updates before being shown
|
||||
if (!$rootScope.$$phase) slideScope.$digest();
|
||||
@@ -334,6 +334,10 @@ function(scope, element, $log, $document, $$q, $timeout, $interval, $$ionicAttac
|
||||
currentDisplayed = newDisplayed;
|
||||
}
|
||||
|
||||
scope.$on('$ionic.reconnectScope', function() {
|
||||
setDisplayedSlides(self.previous(), self.selected(), self.next());
|
||||
});
|
||||
|
||||
function getDelta(fromIndex, toIndex) {
|
||||
var difference = toIndex - fromIndex;
|
||||
if (!isLoop) return difference;
|
||||
|
||||
Reference in New Issue
Block a user