mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(toolbar): fixed the toolbar spacing for iOS with platform-cordova
Added some tests for modals with a toolbar, only target the first toolbar in a menu or modal so the user can have multiple toolbars without skewing them. References #469
This commit is contained in:
@ -1,8 +1,16 @@
|
|||||||
|
|
||||||
it('should open action sheet', function() {
|
it('should open modal', function() {
|
||||||
element(by.css('.e2eOpenModal')).click();
|
element(by.css('.e2eOpenModal')).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should close with close button click', function() {
|
it('should close with close button click', function() {
|
||||||
element(by.css('.e2eCloseMenu')).click();
|
element(by.css('.e2eCloseMenu')).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should open toolbar modal', function() {
|
||||||
|
element(by.css('.e2eOpenToolbarModal')).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should close toolbar modal', function() {
|
||||||
|
element(by.css('.e2eCloseToolbarModal')).click();
|
||||||
|
});
|
||||||
|
@ -33,6 +33,10 @@ class MyAppCmp {
|
|||||||
this.modal.open(PlainPage);
|
this.modal.open(PlainPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openToolbarModal() {
|
||||||
|
this.modal.open(ToolbarModal);
|
||||||
|
}
|
||||||
|
|
||||||
openModalChildNav() {
|
openModalChildNav() {
|
||||||
this.modal.open(ContactModal, {
|
this.modal.open(ContactModal, {
|
||||||
handle: 'my-awesome-modal'
|
handle: 'my-awesome-modal'
|
||||||
@ -63,6 +67,32 @@ class PlainPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Page({
|
||||||
|
template: `
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Modals</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
<ion-toolbar primary>
|
||||||
|
<ion-title>Another toolbar</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<button block danger (click)="closeModal()" class="e2eCloseToolbarModal">
|
||||||
|
<icon close></icon>
|
||||||
|
Close Modal
|
||||||
|
</button>
|
||||||
|
</ion-content>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
class ToolbarModal {
|
||||||
|
constructor(private modal: Modal) {}
|
||||||
|
|
||||||
|
closeModal() {
|
||||||
|
this.modal.get().close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
template: '<ion-nav [root]="rootView"></ion-nav>'
|
template: '<ion-nav [root]="rootView"></ion-nav>'
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
<p>
|
<p>
|
||||||
<button (click)="openModal()">Open plain modal</button>
|
<button (click)="openModal()">Open plain modal</button>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<button class="e2eOpenToolbarModal" (click)="openToolbarModal()">Open modal w/ toolbar</button>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<button (click)="openModalCustomAnimation()">Modal: Custom Animation</button>
|
<button (click)="openModalCustomAnimation()">Modal: Custom Animation</button>
|
||||||
</p>
|
</p>
|
||||||
|
@ -9,14 +9,20 @@ $cordova-ios-toolbar-padding: 2rem !default;
|
|||||||
|
|
||||||
ion-navbar-section,
|
ion-navbar-section,
|
||||||
ion-navbar,
|
ion-navbar,
|
||||||
ion-menu > ion-toolbar {
|
ion-menu > ion-toolbar:first-child,
|
||||||
|
ion-menu > ion-toolbar:first-child ion-title,
|
||||||
|
ion-page.modal > ion-toolbar:first-child,
|
||||||
|
ion-page.modal > ion-toolbar:first-child ion-title, {
|
||||||
min-height: $toolbar-ios-height + $cordova-ios-toolbar-padding;
|
min-height: $toolbar-ios-height + $cordova-ios-toolbar-padding;
|
||||||
height: $toolbar-ios-height + $cordova-ios-toolbar-padding;
|
height: $toolbar-ios-height + $cordova-ios-toolbar-padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-navbar,
|
ion-navbar,
|
||||||
ion-navbar ion-title,
|
ion-navbar ion-title,
|
||||||
ion-menu > ion-toolbar {
|
ion-menu > ion-toolbar:first-child,
|
||||||
|
ion-menu > ion-toolbar:first-child ion-title,
|
||||||
|
ion-page.modal > ion-toolbar:first-child,
|
||||||
|
ion-page.modal > ion-toolbar:first-child ion-title, {
|
||||||
padding-top: $cordova-ios-toolbar-padding;
|
padding-top: $cordova-ios-toolbar-padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user