mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(ionHeaderBar): have no side effects with content in other views
Closes #1095
This commit is contained in:
@@ -172,6 +172,9 @@
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-view title="Auto List">
|
||||
<ion-header-bar class="bar bar-subheader bar-energized">
|
||||
<h1 class="title">some subheader</h1>
|
||||
</ion-header-bar>
|
||||
<ion-content padding="true">
|
||||
<ion-list>
|
||||
<ion-item ng-repeat="auto in autos"
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('bar directives', function() {
|
||||
if (data.tag === 'ion-header-bar') {
|
||||
it('$hasHeader $hasSubheader', function() {
|
||||
var el = setup();
|
||||
var scope = el.scope().$parent;
|
||||
var scope = el.scope();
|
||||
expect(scope.$hasHeader).toEqual(true);
|
||||
expect(scope.$hasSubheader).toEqual(false);
|
||||
el.addClass('bar-subheader');
|
||||
@@ -113,7 +113,7 @@ describe('bar directives', function() {
|
||||
} else {
|
||||
it('$hasFooter $hasSubheader', function() {
|
||||
var el = setup();
|
||||
var scope = el.scope().$parent;
|
||||
var scope = el.scope();
|
||||
expect(scope.$hasFooter).toEqual(true);
|
||||
expect(scope.$hasSubfooter).toEqual(false);
|
||||
el.addClass('bar-subfooter');
|
||||
@@ -127,7 +127,7 @@ describe('bar directives', function() {
|
||||
});
|
||||
it('.has-tabs', function() {
|
||||
var el = setup();
|
||||
var scope = el.scope().$parent;
|
||||
var scope = el.scope();
|
||||
expect(el.hasClass('has-tabs')).toBe(false);
|
||||
scope.$apply('$hasTabs = true');
|
||||
expect(el.hasClass('has-tabs')).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user