mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
aside: fix an error
This commit is contained in:
@ -77,7 +77,7 @@ new IonicComponent(Aside, {
|
|||||||
[instance => instance.side == 'top', gestures.TopAsideGesture],
|
[instance => instance.side == 'top', gestures.TopAsideGesture],
|
||||||
[instance => instance.side == 'bottom', gestures.BottomAsideGesture],
|
[instance => instance.side == 'bottom', gestures.BottomAsideGesture],
|
||||||
[instance => instance.side == 'right', gestures.RightAsideGesture],
|
[instance => instance.side == 'right', gestures.RightAsideGesture],
|
||||||
[instance => instance.side == 'left', gestures.LeftAsideGesture]
|
[instance => instance.side == 'left', gestures.LeftAsideGesture],
|
||||||
],
|
],
|
||||||
type: [
|
type: [
|
||||||
[instance => instance.type == 'overlay', types.AsideTypeOverlay],
|
[instance => instance.type == 'overlay', types.AsideTypeOverlay],
|
||||||
@ -86,4 +86,3 @@ new IonicComponent(Aside, {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {NgElement, Component, Template} from 'angular2/angular2'
|
import {NgElement, Component, Template} from 'angular2/angular2'
|
||||||
|
import {IonicComponent} from 'ionic2/config/component'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-item'
|
selector: 'ion-item'
|
||||||
@ -16,6 +17,8 @@ import {NgElement, Component, Template} from 'angular2/angular2'
|
|||||||
})
|
})
|
||||||
export class Item {
|
export class Item {
|
||||||
constructor(@NgElement() ele:NgElement) {
|
constructor(@NgElement() ele:NgElement) {
|
||||||
ele.domElement.classList.add('item')
|
Item.config.invoke(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new IonicComponent(Item, {})
|
||||||
|
@ -13,18 +13,18 @@ export class DragGesture extends Gesture {
|
|||||||
}
|
}
|
||||||
listen() {
|
listen() {
|
||||||
super.listen();
|
super.listen();
|
||||||
this.hammertime.on('panstart', ev => {
|
this.on('panstart', ev => {
|
||||||
if (this.onDragStart(ev) !== false) {
|
if (this.onDragStart(ev) !== false) {
|
||||||
this.dragging = true;
|
this.dragging = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.hammertime.on('panmove', ev => {
|
this.on('panmove', ev => {
|
||||||
if (!this.dragging) return;
|
if (!this.dragging) return;
|
||||||
if (this.onDrag(ev) === false) {
|
if (this.onDrag(ev) === false) {
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.hammertime.on('panend', ev => {
|
this.on('panend', ev => {
|
||||||
if (!this.dragging) return;
|
if (!this.dragging) return;
|
||||||
this.onDragEnd(ev);
|
this.onDragEnd(ev);
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
|
@ -18,6 +18,10 @@ export class Gesture {
|
|||||||
util.extend(this._options, opts);
|
util.extend(this._options, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
on(...args) {
|
||||||
|
return this.hammertime.on.apply(this.hammertime, args)
|
||||||
|
}
|
||||||
|
|
||||||
listen() {
|
listen() {
|
||||||
this.hammertime = Hammer(this.element, this._options);
|
this.hammertime = Hammer(this.element, this._options);
|
||||||
}
|
}
|
||||||
@ -26,7 +30,7 @@ export class Gesture {
|
|||||||
this.hammertime = null;
|
this.hammertime = null;
|
||||||
}
|
}
|
||||||
destroy() {
|
destroy() {
|
||||||
this.hammertime.destroy();
|
this.unlisten()
|
||||||
this.hammertime = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user