mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(tabs): preventDefault when anchor is clicked
This commit is contained in:
5
js/ext/angular/src/directive/ionicTabBar.js
vendored
5
js/ext/angular/src/directive/ionicTabBar.js
vendored
@@ -245,7 +245,7 @@ function($scope, $ionicViewService, $rootScope, $element) {
|
||||
require: ['^ionTabs', '^ionTab'],
|
||||
template:
|
||||
'<a ng-class="{active: isTabActive(), \'has-badge\':badge}" ' +
|
||||
'ng-click="selectTab()" class="tab-item">' +
|
||||
'ng-click="selectTab($event)" class="tab-item">' +
|
||||
'<span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span>' +
|
||||
'<i class="icon {{iconOn}}" ng-if="iconOn && isTabActive()"></i>' +
|
||||
'<i class="icon {{iconOff}}" ng-if="iconOff && !isTabActive()"></i>' +
|
||||
@@ -273,7 +273,8 @@ function($scope, $ionicViewService, $rootScope, $element) {
|
||||
$scope.isTabActive = function() {
|
||||
return tabsCtrl.selectedTab === tabCtrl.$scope;
|
||||
};
|
||||
$scope.selectTab = function() {
|
||||
$scope.selectTab = function(e) {
|
||||
e.preventDefault();
|
||||
tabsCtrl.select(tabCtrl.$scope, true);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user