mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
1
js/ext/angular/src/directive/ionicList.js
vendored
1
js/ext/angular/src/directive/ionicList.js
vendored
@@ -214,6 +214,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
|
||||
link: function($scope, $element, $attr, ionicScrollCtrl) {
|
||||
$scope.listView = new ionic.views.ListView({
|
||||
canSwipe: $scope.canSwipe !== "false" && !!$scope.optionButtons(),
|
||||
el: $element[0],
|
||||
listEl: $element[0].children[0],
|
||||
scrollEl: ionicScrollCtrl && ionicScrollCtrl.element,
|
||||
|
||||
@@ -14,14 +14,17 @@
|
||||
|
||||
<ion-pane ion-side-menu-content>
|
||||
<header class="bar bar-header bar-positive">
|
||||
<button class="button button-icon ion-navicon" ng-click="sideMenuController.toggleLeft(false)"></button>
|
||||
<button class="button button-icon ion-navicon" ng-click="$ionicSideMenusController.toggleLeft()"></button>
|
||||
<h1 class="title">Slide me</h1>
|
||||
<button class="button button-icon ion-navicon" ng-click="sideMenuController.toggleRight(false)"></button>
|
||||
<button class="button button-icon ion-navicon" ng-click="$ionicSideMenusController.toggleRight()"></button>
|
||||
</header>
|
||||
<ion-content class="has-header">
|
||||
<ion-toggle ng-model="$root.$draggy">Hello</ion-toggle>
|
||||
<input type="range" ng-model="$root.menuWidth" min="0" max="300">
|
||||
<h1>Content</h1>
|
||||
<ion-list option-buttons="[{text:'Hello',type:'button-positive'}]">
|
||||
<ion-item>Sup</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-pane>
|
||||
|
||||
|
||||
@@ -315,7 +315,8 @@
|
||||
opts = ionic.extend({
|
||||
onReorder: function(el, oldIndex, newIndex) {},
|
||||
virtualRemoveThreshold: -200,
|
||||
virtualAddThreshold: 200
|
||||
virtualAddThreshold: 200,
|
||||
canSwipe: false
|
||||
}, opts);
|
||||
|
||||
ionic.extend(this, opts);
|
||||
@@ -505,6 +506,10 @@
|
||||
_handleDrag: function(e) {
|
||||
var _this = this, content, buttons;
|
||||
|
||||
if (!this.canSwipe) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Math.abs(e.gesture.deltaY) > 5) {
|
||||
this._didDragUpOrDown = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user