diff --git a/js/angular/controller/tabsController.js b/js/angular/controller/tabsController.js index f98c0af98b..9aa92ec243 100644 --- a/js/angular/controller/tabsController.js +++ b/js/angular/controller/tabsController.js @@ -1,18 +1,19 @@ IonicModule .controller('$ionicTabs', [ '$scope', - '$ionicHistory', '$element', -function($scope, $ionicHistory, $element) { - var _selectedTab = null; + '$ionicHistory', +function($scope, $element, $ionicHistory) { var self = this; + var selectedTab = null; + var selectedTabIndex; self.tabs = []; self.selectedIndex = function() { - return self.tabs.indexOf(_selectedTab); + return self.tabs.indexOf(selectedTab); }; self.selectedTab = function() { - return _selectedTab; + return selectedTab; }; self.add = function(tab) { @@ -42,7 +43,7 @@ function($scope, $ionicHistory, $element) { self.deselect = function(tab) { if (tab.$tabSelected) { - _selectedTab = null; + selectedTab = selectedTabIndex = null; tab.$tabSelected = false; (tab.onDeselect || angular.noop)(); tab.$broadcast && tab.$broadcast('$ionicHistory.deselect'); @@ -63,16 +64,23 @@ function($scope, $ionicHistory, $element) { shouldEmitEvent = !!(tab.navViewName || tab.uiSref); } - if (_selectedTab && _selectedTab.$historyId == tab.$historyId) { + if (selectedTab && selectedTab.$historyId == tab.$historyId) { if (shouldEmitEvent) { $ionicHistory.goToHistoryRoot(tab.$historyId); } - } else { + + } else if (selectedTabIndex !== tabIndex) { forEach(self.tabs, function(tab) { self.deselect(tab); }); - _selectedTab = tab; + selectedTab = tab; + selectedTabIndex = tabIndex; + + if (self.$scope && self.$scope.$parent) { + self.$scope.$parent.$activeHistoryId = tab.$historyId; + } + //Use a funny name like $tabSelected so the developer doesn't overwrite the var in a child scope tab.$tabSelected = true; (tab.onSelect || angular.noop)(); diff --git a/js/angular/service/history.js b/js/angular/service/history.js index aa93b8897c..592fbcc7fd 100644 --- a/js/angular/service/history.js +++ b/js/angular/service/history.js @@ -664,7 +664,7 @@ function($rootScope, $state, $location, $window, $timeout, $ionicViewSwitcher, $ if (climbScope.$$disconnected) { return false; } - if (currentHistoryId && currentHistoryId == climbScope.$historyId) { + if (currentHistoryId && (currentHistoryId == climbScope.$historyId || currentHistoryId == climbScope.$activeHistoryId)) { return true; } climbScope = climbScope.$parent; diff --git a/scss/_slide-box.scss b/scss/_slide-box.scss index 55a1ed9622..7c8b78a790 100644 --- a/scss/_slide-box.scss +++ b/scss/_slide-box.scss @@ -77,3 +77,15 @@ ion-slide { } } } + +.modal { + .slider { + position: absolute; + width: 100%; + height: 100%; + } + + .slider-slides, .slider-slide { + height: 100%; + } +}