mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix back button, add deprecation warnings
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
||||||
#### CSS Refactor
|
##### CSS Refactor
|
||||||
|
|
||||||
* Attributes are now used by Ionic to add the correct CSS classes to elements
|
* Attributes are now used by Ionic to add the correct CSS classes to elements
|
||||||
* Drastically reduced the depth of CSS selectors
|
* Drastically reduced the depth of CSS selectors
|
||||||
@ -19,7 +19,9 @@
|
|||||||
* ie: Gray navbars in iOS, blue navbars in MD. Identical HTML/JS
|
* ie: Gray navbars in iOS, blue navbars in MD. Identical HTML/JS
|
||||||
|
|
||||||
|
|
||||||
#### `<ion-nav-items>` renamed to `<ion-buttons>`
|
##### `<ion-nav-items>` renamed to `<ion-buttons>`
|
||||||
|
|
||||||
* `primary` attribute `<ion-nav-items primary>` now `<ion-buttons start>`
|
* `primary` attribute `<ion-nav-items primary>` now `<ion-buttons start>`
|
||||||
* `secondary` attribute `<ion-nav-items secondary>` now `<ion-buttons end>`
|
* `secondary` attribute `<ion-nav-items secondary>` now `<ion-buttons end>`
|
||||||
|
|
||||||
|
##### <a menu-toggle> should now be <button menu-toggle>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
<ion-navbar *navbar class="show-navbar">
|
<ion-navbar *navbar class="show-navbar">
|
||||||
|
|
||||||
<a menu-toggle="leftMenu">
|
<button menu-toggle="leftMenu">
|
||||||
<icon menu></icon>
|
<icon menu></icon>
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Basic List
|
Basic List
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
<ion-navbar *navbar class="show-navbar">
|
<ion-navbar *navbar class="show-navbar">
|
||||||
|
|
||||||
<a menu-toggle="leftMenu">
|
<button menu-toggle="leftMenu">
|
||||||
<icon menu></icon>
|
<icon menu></icon>
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Inset List
|
Inset List
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
<ion-navbar *navbar class="show-navbar">
|
<ion-navbar *navbar class="show-navbar">
|
||||||
|
|
||||||
<a menu-toggle="leftMenu">
|
<button menu-toggle="leftMenu">
|
||||||
<icon menu></icon>
|
<icon menu></icon>
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
<ion-title>
|
<ion-title>
|
||||||
List Headers
|
List Headers
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
<ion-navbar *navbar class="show-navbar">
|
<ion-navbar *navbar class="show-navbar">
|
||||||
|
|
||||||
<a menu-toggle="leftMenu">
|
<button menu-toggle="leftMenu">
|
||||||
<icon menu></icon>
|
<icon menu></icon>
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
<ion-title>
|
<ion-title>
|
||||||
No-lines List
|
No-lines List
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
<ion-navbar *navbar class="show-navbar">
|
<ion-navbar *navbar class="show-navbar">
|
||||||
|
|
||||||
<a menu-toggle="leftMenu">
|
<button menu-toggle="leftMenu">
|
||||||
<icon menu></icon>
|
<icon menu></icon>
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Sliding Items
|
Sliding Items
|
||||||
|
@ -34,6 +34,11 @@ export class MenuToggle extends Ion {
|
|||||||
this.app = app;
|
this.app = app;
|
||||||
this.viewCtrl = viewCtrl;
|
this.viewCtrl = viewCtrl;
|
||||||
this.withinNavbar = !!navbar;
|
this.withinNavbar = !!navbar;
|
||||||
|
|
||||||
|
// Deprecation warning
|
||||||
|
if (this.withinNavbar && elementRef.nativeElement.tagName === 'A') {
|
||||||
|
console.warn('Menu toggles within a navbar should use <button menu-toggle> instead of <a toggle>')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
<ion-navbar *navbar>
|
<ion-navbar *navbar>
|
||||||
<a [menu-toggle]="activeMenu">
|
<button [menu-toggle]="activeMenu">
|
||||||
<icon menu></icon>
|
<icon menu></icon>
|
||||||
</a>
|
</button>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Multiple Menus
|
Multiple Menus
|
||||||
</ion-title>
|
</ion-title>
|
||||||
|
@ -65,7 +65,7 @@ class ToolbarBackground {
|
|||||||
selector: 'ion-navbar',
|
selector: 'ion-navbar',
|
||||||
template:
|
template:
|
||||||
'<div class="toolbar-background"></div>' +
|
'<div class="toolbar-background"></div>' +
|
||||||
'<button class="back-button" [hidden]="hideBackButton">' +
|
'<button class="back-button bar-button bar-button-default" [hidden]="hideBackButton">' +
|
||||||
'<icon class="back-button-icon" [name]="bbIcon"></icon>' +
|
'<icon class="back-button-icon" [name]="bbIcon"></icon>' +
|
||||||
'<span class="back-button-text">' +
|
'<span class="back-button-text">' +
|
||||||
'<span class="back-default">{{bbText}}</span>' +
|
'<span class="back-default">{{bbText}}</span>' +
|
||||||
|
@ -79,6 +79,9 @@ export class Label {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
addClass(className) {
|
addClass(className) {
|
||||||
this.renderer.setElementClass(this.elementRef, className, true);
|
this.renderer.setElementClass(this.elementRef, className, true);
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,9 @@ ion-title {
|
|||||||
background-color: $color-value;
|
background-color: $color-value;
|
||||||
border-color: darken($color-value, 10%);
|
border-color: darken($color-value, 10%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-title {
|
.toolbar-title,
|
||||||
|
.bar-button-default {
|
||||||
color: inverse($color-value);
|
color: inverse($color-value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ export class ToolbarTitle extends Ion {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'ion-buttons,[menu-toggle]'
|
selector: 'ion-buttons,[menu-toggle],ion-nav-items'
|
||||||
})
|
})
|
||||||
export class ToolbarItem {
|
export class ToolbarItem {
|
||||||
constructor(
|
constructor(
|
||||||
@ -160,6 +160,23 @@ export class ToolbarItem {
|
|||||||
toolbar && toolbar.addItemRef(elementRef);
|
toolbar && toolbar.addItemRef(elementRef);
|
||||||
navbar && navbar.addItemRef(elementRef);
|
navbar && navbar.addItemRef(elementRef);
|
||||||
this.inToolbar = !!(toolbar || navbar);
|
this.inToolbar = !!(toolbar || navbar);
|
||||||
|
|
||||||
|
// Deprecation warning
|
||||||
|
if (elementRef.nativeElement.tagName === 'ION-NAV-ITEMS') {
|
||||||
|
|
||||||
|
if (elementRef.nativeElement.hasAttribute('primary')) {
|
||||||
|
console.warn('<ion-nav-items primary> has been renamed to <ion-buttons start>, please update your HTML');
|
||||||
|
elementRef.nativeElement.setAttribute('start', '');
|
||||||
|
|
||||||
|
} else if (elementRef.nativeElement.hasAttribute('secondary')) {
|
||||||
|
console.warn('<ion-nav-items secondary> has been renamed to <ion-buttons end>, please update your HTML');
|
||||||
|
elementRef.nativeElement.setAttribute('end', '');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.warn('<ion-nav-items> has been renamed to <ion-buttons>, please update your HTML');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ContentChildren(Button)
|
@ContentChildren(Button)
|
||||||
|
Reference in New Issue
Block a user