mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
Merge branch 'master' into css-refactor
This commit is contained in:
2
demos/action-sheet/app.html
Normal file
2
demos/action-sheet/app.html
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<ion-nav id="nav" [root]="rootPage" #content></ion-nav>
|
||||||
|
<ion-overlay></ion-overlay>
|
@ -1,41 +1,51 @@
|
|||||||
import {App, ActionSheet} from 'ionic/ionic';
|
import {App, Page, IonicApp, Config, Platform} from 'ionic/ionic';
|
||||||
|
import {ActionSheet} from 'ionic/ionic';
|
||||||
|
|
||||||
@App({
|
@App({
|
||||||
|
templateUrl: 'app.html'
|
||||||
|
})
|
||||||
|
class ApiDemoApp {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.rootPage = InitialPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Page({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
class IonicApp {
|
export class InitialPage {
|
||||||
|
constructor(actionSheet: ActionSheet, platform: Platform) {
|
||||||
constructor(actionSheet: ActionSheet) {
|
|
||||||
this.actionSheet = actionSheet;
|
this.actionSheet = actionSheet;
|
||||||
|
this.platform = platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
openMenu() {
|
open() {
|
||||||
|
|
||||||
this.actionSheet.open({
|
this.actionSheet.open({
|
||||||
buttons: [
|
buttons: [
|
||||||
{ text: 'Share This' },
|
{ text: 'Share'},
|
||||||
{ text: 'Move' }
|
{ text: 'Play'},
|
||||||
|
{ text: 'Favorite'}
|
||||||
],
|
],
|
||||||
destructiveText: 'Delete',
|
destructiveText: 'Delete',
|
||||||
titleText: 'Modify your album',
|
titleText: 'Albums',
|
||||||
cancelText: 'Cancel',
|
cancelText: 'Cancel',
|
||||||
cancel: function() {
|
cancel: () => {
|
||||||
console.log('Canceled');
|
console.log('Canceled');
|
||||||
},
|
},
|
||||||
destructiveButtonClicked: () => {
|
destructiveButtonClicked: () => {
|
||||||
console.log('Destructive clicked');
|
console.log('Destructive clicked');
|
||||||
},
|
},
|
||||||
buttonClicked: function(index) {
|
buttonClicked: (index) => {
|
||||||
console.log('Button clicked', index);
|
console.log('Button clicked', index);
|
||||||
if(index == 1) { return false; }
|
if (index == 1) { return false; }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}).then(actionSheetRef => {
|
}).then(actionSheetRef => {
|
||||||
this.actionSheetRef = actionSheetRef;
|
this.actionSheetRef = actionSheetRef;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
<ion-navbar *navbar>
|
||||||
|
<ion-title>Action Sheet</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<button (click)="openMenu()">Open Action Sheet</button>
|
<ion-row>
|
||||||
</ion-content>
|
<button full block (click)="open()">Open Action Sheet</button>
|
||||||
|
</ion-row>
|
||||||
|
<ion-content>
|
||||||
|
1
demos/hide-when/app.html
Normal file
1
demos/hide-when/app.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<ion-nav id="nav" [root]="rootPage" #content></ion-nav>
|
20
demos/hide-when/index.ts
Normal file
20
demos/hide-when/index.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {App, Page, IonicApp} from 'ionic/ionic';
|
||||||
|
|
||||||
|
@App({
|
||||||
|
templateUrl: 'app.html'
|
||||||
|
})
|
||||||
|
class ApiDemoApp {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.rootPage = InitialPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Page({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
export class InitialPage {
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
9
demos/hide-when/main.html
Normal file
9
demos/hide-when/main.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<ion-navbar *navbar>
|
||||||
|
<ion-title>HideWhen</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<p hide-when="android">
|
||||||
|
<b>(hide-when="android")</b> This text is hidden on Android only. Click the Android tab to hide this text.
|
||||||
|
</p>
|
||||||
|
<ion-content>
|
1
demos/show-when/app.html
Normal file
1
demos/show-when/app.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<ion-nav id="nav" [root]="rootPage" #content></ion-nav>
|
20
demos/show-when/index.ts
Normal file
20
demos/show-when/index.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {App, Page, IonicApp} from 'ionic/ionic';
|
||||||
|
|
||||||
|
@App({
|
||||||
|
templateUrl: 'app.html'
|
||||||
|
})
|
||||||
|
class ApiDemoApp {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.rootPage = InitialPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Page({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
export class InitialPage {
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
9
demos/show-when/main.html
Normal file
9
demos/show-when/main.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<ion-navbar *navbar>
|
||||||
|
<ion-title>ShowWhen</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<p show-when="ios">
|
||||||
|
<b>(show-when="ios")</b> This text is shown on iOS only. Click the Android tab to hide this text.
|
||||||
|
</p>
|
||||||
|
<ion-content>
|
@ -109,6 +109,7 @@ class ActionSheetCmp {
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
* @demo /docs/v2/demos/action-sheet/
|
||||||
* @see {@link /docs/v2/components#action-sheets ActionSheet Component Docs}
|
* @see {@link /docs/v2/components#action-sheets ActionSheet Component Docs}
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -53,12 +53,15 @@ class DisplayWhen {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* The `show-when` attribute takes a value or expression, and only shows the element it has been added to when
|
* The `show-when` attribute takes a string that represents a plaform or screen orientation.
|
||||||
* the value or expression is true. Complements the [hide-when attribute](../HideWhen).
|
* The element the attribute is added to will only be shown when that platform or screen orientation is active.
|
||||||
|
* Complements the [hide-when attribute](../HideWhen).
|
||||||
* @usage
|
* @usage
|
||||||
* ```html
|
* ```html
|
||||||
* <div show-when="false">I am hidden!</div>
|
* <div show-when="ios">I am only visible on iOS!</div>
|
||||||
* ```
|
* ```
|
||||||
|
* @demo /docs/v2/demos/show-when/
|
||||||
|
* @see {@link ../HideWhen HideWhen API Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[show-when]',
|
selector: '[show-when]',
|
||||||
@ -87,12 +90,15 @@ export class ShowWhen extends DisplayWhen {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* The `hide-when` attribute takes a value or expression, and hides the element it has been added to when
|
* The `hide-when` attribute takes a string that represents a plaform or screen orientation.
|
||||||
* the value or expression is true. Complements the [show-when attribute](../ShowWhen).
|
* The element the attribute is added to will only be hidden when that platform or screen orientation is active.
|
||||||
|
* Complements the [show-when attribute](../ShowWhen).
|
||||||
* @usage
|
* @usage
|
||||||
* ```html
|
* ```html
|
||||||
* <div hide-when="true">I am hidden!</div>
|
* <div hide-when="android">I am hidden on Android!</div>
|
||||||
* ```
|
* ```
|
||||||
|
* @demo /docs/v2/demos/hide-when/
|
||||||
|
* @see {@link ../ShowWhen ShowWhen API Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[hide-when]',
|
selector: '[hide-when]',
|
||||||
|
Reference in New Issue
Block a user