mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
3
js/angular/controller/navBarController.js
vendored
3
js/angular/controller/navBarController.js
vendored
@@ -335,11 +335,12 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
|
||||
|
||||
|
||||
self.title = function(newTitleText, headerBar) {
|
||||
if (arguments.length) {
|
||||
if (isDefined(newTitleText)) {
|
||||
newTitleText = newTitleText || '';
|
||||
headerBar = headerBar || getOnScreenHeaderBar();
|
||||
headerBar && headerBar.title(newTitleText);
|
||||
$scope.$title = newTitleText;
|
||||
$ionicHistory.currentTitle(newTitleText);
|
||||
}
|
||||
return $scope.$title;
|
||||
};
|
||||
|
||||
5
js/angular/controller/scrollController.js
vendored
5
js/angular/controller/scrollController.js
vendored
@@ -11,7 +11,8 @@ IonicModule
|
||||
'$location',
|
||||
'$document',
|
||||
'$ionicScrollDelegate',
|
||||
function($scope, scrollViewOptions, $timeout, $window, $location, $document, $ionicScrollDelegate) {
|
||||
'$ionicHistory',
|
||||
function($scope, scrollViewOptions, $timeout, $window, $location, $document, $ionicScrollDelegate, $ionicHistory) {
|
||||
|
||||
var self = this;
|
||||
// for testing
|
||||
@@ -31,7 +32,7 @@ function($scope, scrollViewOptions, $timeout, $window, $location, $document, $io
|
||||
|
||||
var deregisterInstance = $ionicScrollDelegate._registerInstance(
|
||||
self, scrollViewOptions.delegateHandle, function() {
|
||||
return !$scope.$$disconnected;
|
||||
return !$scope.$$disconnected && $ionicHistory.currentHistoryId() == $scope.$historyId;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
6
js/angular/controller/viewController.js
vendored
6
js/angular/controller/viewController.js
vendored
@@ -4,9 +4,8 @@ IonicModule
|
||||
'$element',
|
||||
'$attrs',
|
||||
'$compile',
|
||||
'$ionicHistory',
|
||||
'$ionicViewSwitcher',
|
||||
function($scope, $element, $attrs, $compile, $ionicHistory, $ionicViewSwitcher) {
|
||||
function($scope, $element, $attrs, $compile, $ionicViewSwitcher) {
|
||||
var self = this;
|
||||
var navElementHtml = {};
|
||||
var navViewCtrl;
|
||||
@@ -44,8 +43,6 @@ function($scope, $element, $attrs, $compile, $ionicHistory, $ionicViewSwitcher)
|
||||
|
||||
var viewTitle = $attrs.viewTitle || $attrs.title;
|
||||
|
||||
$ionicHistory.currentTitle(viewTitle);
|
||||
|
||||
var buttons = {};
|
||||
for (var n in navElementHtml) {
|
||||
buttons[n] = generateButton(navElementHtml[n]);
|
||||
@@ -77,7 +74,6 @@ function($scope, $element, $attrs, $compile, $ionicHistory, $ionicViewSwitcher)
|
||||
if (viewTitleAttr) {
|
||||
deregisters.push($attrs.$observe(viewTitleAttr, function(val) {
|
||||
navViewCtrl.title(val);
|
||||
$ionicHistory.currentTitle(val);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user