mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(ionTab): stop browser-tooltip from appearing due to title attr
Closes #804
This commit is contained in:
3
js/ext/angular/src/directive/ionicTabBar.js
vendored
3
js/ext/angular/src/directive/ionicTabBar.js
vendored
@@ -365,6 +365,9 @@ function($rootScope, $animate, $ionicBind, $compile, $ionicViewService) {
|
||||
var tabsCtrl = ctrls[0],
|
||||
tabCtrl = ctrls[1];
|
||||
|
||||
//Remove title attribute so browser-tooltip does not apear
|
||||
$element[0].removeAttribute('title');
|
||||
|
||||
$scope.selectTab = function(e) {
|
||||
e.preventDefault();
|
||||
tabsCtrl.select(tabCtrl.$scope, true);
|
||||
|
||||
@@ -294,7 +294,9 @@ describe('tabs', function() {
|
||||
it('should compile a <ion-tab-nav> with all of the relevant attrs', function() {
|
||||
setup('title=1 icon-on=2 icon-off=3 badge=4 badge-style=5 ng-click=6');
|
||||
var navItem = angular.element(tabsEl[0].querySelector('.tab-item'));
|
||||
expect(navItem.attr('title')).toEqual('1');
|
||||
//Use .scope for title because we remove title attr
|
||||
//(for dom-tooltip not to appear)
|
||||
expect(navItem.scope().title).toEqual('1');
|
||||
expect(navItem.attr('icon-on')).toEqual('2');
|
||||
expect(navItem.attr('icon-off')).toEqual('3');
|
||||
expect(navItem.attr('badge')).toEqual('4');
|
||||
@@ -401,6 +403,12 @@ describe('tabs', function() {
|
||||
return element;
|
||||
}
|
||||
|
||||
it('should remove title attribute', function() {
|
||||
var el = setup('title="something"');
|
||||
expect(el[0].hasAttribute('title')).toBe(false);
|
||||
expect(el.isolateScope().title).toBe('something');
|
||||
});
|
||||
|
||||
// These next two are REALLY specific unit tests,
|
||||
// but also are really really vital pieces of code
|
||||
it('.isTabActive should be correct', function() {
|
||||
|
||||
Reference in New Issue
Block a user