mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-27 14:22:21 -06:00
40 lines
832 B
JavaScript
40 lines
832 B
JavaScript
IonSideMenu = {
|
|
snapper: null
|
|
};
|
|
|
|
Template.ionSideMenuContainer.created = function () {
|
|
this.data = this.data || {};
|
|
this.side = this.data.side || 'both';
|
|
this.dragContent = true;
|
|
if (typeof this.data.dragContent != 'undefined') {
|
|
this.dragContent = this.data.dragContent
|
|
}
|
|
};
|
|
|
|
Template.ionSideMenuContainer.rendered = function () {
|
|
$snapperEl = this.$('.snap-content');
|
|
if (!$snapperEl) {
|
|
return;
|
|
}
|
|
|
|
var disable;
|
|
if (this.side == 'both') {
|
|
disable = 'none';
|
|
}
|
|
if (this.side == 'left') {
|
|
disable = 'right';
|
|
}
|
|
if (this.side == 'right') {
|
|
disable = 'left';
|
|
}
|
|
|
|
IonSideMenu.snapper = new Snap({
|
|
element: $snapperEl.get(0),
|
|
disable: disable,
|
|
touchToDrag: this.dragContent
|
|
});
|
|
};
|
|
|
|
Template.ionSideMenuContainer.destroyed = function () {
|
|
IonSideMenu.snapper = null;
|
|
};
|