mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
Reviving Action Menu
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
// DON'T reference this file in the source. Only in demos.
|
// DON'T reference this file in the source. Only in demos.
|
||||||
// export * from 'ionic/components/action-menu/action-menu'
|
export * from 'ionic/components/action-menu/action-menu'
|
||||||
// export * from 'ionic/components/alert/alert'
|
// export * from 'ionic/components/alert/alert'
|
||||||
export * from 'ionic/components/aside/aside'
|
export * from 'ionic/components/aside/aside'
|
||||||
export * from 'ionic/components/button/button'
|
export * from 'ionic/components/button/button'
|
||||||
|
@ -1,49 +1,63 @@
|
|||||||
// import {NgElement, Component, View, Parent} from 'angular2/angular2'
|
import {DynamicComponentLoader, ElementRef, ComponentRef, onDestroy, DomRenderer} from 'angular2/angular2';
|
||||||
// import {IonicComponent} from 'ionic/config/component'
|
import {bind, Injector} from 'angular2/di';
|
||||||
// import {Icon} from 'ionic/components/icon/icon'
|
import {Promise} from 'angular2/src/facade/async';
|
||||||
// import {Item} from 'ionic/components/item/item'
|
import {isPresent, Type} from 'angular2/src/facade/lang';
|
||||||
|
|
||||||
|
import {Component, Directive, Item, Icon} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
|
import {Parent} from 'angular2/src/core/annotations_impl/visibility';
|
||||||
|
|
||||||
|
import {IonicComponent} from 'ionic/config/component'
|
||||||
|
import {raf, ready} from 'ionic/util/dom'
|
||||||
|
|
||||||
|
import {Animation} from 'ionic/animations/animation';
|
||||||
|
|
||||||
|
|
||||||
// @Component({
|
@Component({
|
||||||
// selector: 'ion-action-menu'
|
selector: 'ion-action-menu'
|
||||||
// })
|
})
|
||||||
// @View({
|
@View({
|
||||||
// template: `
|
template: `
|
||||||
// <div class="overlay-backdrop"></div>
|
<div class="overlay-backdrop"></div>
|
||||||
// <div class="overlay-container">
|
<div class="overlay-container">
|
||||||
// <div class="action-menu-container">
|
<div class="action-menu-container">
|
||||||
|
|
||||||
// <div class="list-header">Action Menu List Header</div>
|
<div class="list-header">Action Menu List Header</div>
|
||||||
// <div class="list">
|
<div class="list">
|
||||||
// <button ion-item class="item">
|
<button ion-item class="item">
|
||||||
// Button 1
|
Button 1
|
||||||
// </button>
|
</button>
|
||||||
// <button ion-item class="item">
|
<button ion-item class="item">
|
||||||
// Button 2
|
Button 2
|
||||||
// </button>
|
</button>
|
||||||
// </div>
|
</div>
|
||||||
|
|
||||||
// <div class="list-header">Action Menu Label</div>
|
<div class="list-header">Action Menu Label</div>
|
||||||
// <div class="list">
|
<div class="list">
|
||||||
// <button ion-item class="item">Button 1</button>
|
<button ion-item class="item">Button 1</button>
|
||||||
// <button ion-item class="item">Button 2</button>
|
<button ion-item class="item">Button 2</button>
|
||||||
// </div>
|
</div>
|
||||||
|
|
||||||
// <div class="list">
|
<div class="list">
|
||||||
// <button ion-item class="item">Button 1</button>
|
<button ion-item class="item">Button 1</button>
|
||||||
// </div>
|
</div>
|
||||||
|
|
||||||
// </div>
|
</div>
|
||||||
// </div>`,
|
</div>`,
|
||||||
// directives: [Item,Icon]
|
directives: [Item,Icon]
|
||||||
// })
|
})
|
||||||
// export class ActionMenu {
|
export class ActionMenu {
|
||||||
// constructor(
|
constructor(
|
||||||
// @NgElement() ngElement:NgElement
|
elementRef: ElementRef
|
||||||
// ) {
|
) {
|
||||||
// this.domElement = ngElement.domElement
|
this.domElement = elementRef.domElement
|
||||||
// this.config = ActionMenu.config.invoke(this)
|
this.config = ActionMenu.config.invoke(this)
|
||||||
// }
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// new IonicComponent(ActionMenu, {})
|
static open(opts) {
|
||||||
|
console.log('Opening menu', opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
new IonicComponent(ActionMenu, {})
|
||||||
|
@ -8,12 +8,18 @@ import {ActionMenu} from 'ionic/components/action-menu/action-menu';
|
|||||||
@Component({ selector: 'ion-app' })
|
@Component({ selector: 'ion-app' })
|
||||||
@View({
|
@View({
|
||||||
templateUrl: 'main.html',
|
templateUrl: 'main.html',
|
||||||
directives: [ActionMenu]
|
|
||||||
})
|
})
|
||||||
class IonicApp {
|
class IonicApp {
|
||||||
constructor() {
|
constructor() {
|
||||||
console.log('IonicApp Start')
|
console.log('IonicApp Start')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openMenu() {
|
||||||
|
console.log('Opening ActionMenu')
|
||||||
|
ActionMenu.open({
|
||||||
|
title: 'Do you really want to?'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
<ion-content padding>
|
||||||
<ion-action-menu>
|
<button primary (click)="openMenu()">Open Menu</button>
|
||||||
|
</ion-content>
|
||||||
</ion-action-menu>
|
|
||||||
|
Reference in New Issue
Block a user