Skip to content

Commit

Permalink
Fixed #179
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Nov 26, 2013
1 parent 91826e3 commit 3c23369
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 12 deletions.
7 changes: 5 additions & 2 deletions dist/js/ionic-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,9 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])
e.gesture.srcEvent.preventDefault();
};

var dragGesture = Gesture.on('drag', dragFn, $element);
//var dragGesture = Gesture.on('drag', dragFn, $element);
var dragRightGesture = Gesture.on('dragright', dragFn, $element);
var dragLeftGesture = Gesture.on('dragleft', dragFn, $element);

var dragReleaseFn = function(e) {
if(!defaultPrevented) {
Expand Down Expand Up @@ -1907,7 +1909,8 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])

// Cleanup
$scope.$on('$destroy', function() {
Gesture.off(dragGesture, 'drag', dragFn);
Gesture.off(dragLeftGesture, 'drag', dragFn);
Gesture.off(dragRightGesture, 'drag', dragFn);
Gesture.off(releaseGesture, 'release', dragReleaseFn);
});
};
Expand Down
7 changes: 5 additions & 2 deletions js/ext/angular/src/directive/ionicSideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])
e.gesture.srcEvent.preventDefault();
};

var dragGesture = Gesture.on('drag', dragFn, $element);
//var dragGesture = Gesture.on('drag', dragFn, $element);
var dragRightGesture = Gesture.on('dragright', dragFn, $element);
var dragLeftGesture = Gesture.on('dragleft', dragFn, $element);

var dragReleaseFn = function(e) {
if(!defaultPrevented) {
Expand Down Expand Up @@ -106,7 +108,8 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])

// Cleanup
$scope.$on('$destroy', function() {
Gesture.off(dragGesture, 'drag', dragFn);
Gesture.off(dragLeftGesture, 'drag', dragFn);
Gesture.off(dragRightGesture, 'drag', dragFn);
Gesture.off(releaseGesture, 'release', dragReleaseFn);
});
};
Expand Down
8 changes: 0 additions & 8 deletions js/ext/angular/test/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@
title="'Title'"
type="bar-primary"></header-bar>

<div class="bar bar-subheader">
<div class="button-bar">
<a class="button">Success</a>
<a class="button">Warning</a>
<a class="button">Danger</a>
</div>
</div>

<content
on-refresh="onRefresh()"
on-refresh-opening="onRefreshOpening(amount)"
Expand Down
136 changes: 136 additions & 0 deletions js/ext/angular/test/overflow.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<html ng-app="navTest">
<head>
<meta charset="utf-8">
<title>Content</title>

<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../../../dist/css/ionic.css">

<script src="../../../../dist/js/ionic.js"></script>
<script src="../../../../dist/js/angular/angular.js"></script>
<script src="../../../../dist/js/angular/angular-animate.js"></script>
<script src="../../../../dist/js/angular/angular-route.js"></script>
<script src="../../../../dist/js/angular/angular-touch.js"></script>
<script src="../../../../dist/js/angular/angular-sanitize.js"></script>
<script src="../../../../dist/js/ionic-angular.js"></script>
<style>
.reveal-animation {
/*
-webkit-transform: translate3d(0%, 0, 0);
transform: translate3d(0%, 0, 0);

-webkit-transition: -webkit-transform 1s ease-in-out;
transition: transform 1s ease-in-out;
*/
}
.reveal-animation.ng-enter {
-webkit-transition: .2s ease-in-out all;
-webkit-transform:translate3d(100%,0,0) ;
}
.reveal-animation.ng-enter-active {
-webkit-transform:translate3d(0,0,0) ;
}
.reveal-animation.ng-leave {
-webkit-transition: .2s ease-in-out all;
-webkit-transform:translate3d(0%,0,0);
}
.reveal-animation.ng-leave-active {
-webkit-transition: .2s ease-in-out all;
-webkit-transform:translate3d(-100%,0,0);
}

.scroll-refresher {
border-bottom: 1px solid #eee;
}
#refresh-content {
color: #999;
text-align: center;
font-size: 48px;
position: absolute;
bottom: 10px;
width: 100%;
}
</style>

</head>
<body ng-controller="AppCtrl">
<side-menus>
<pane side-menu-content>
<header-bar
title="'Title'"
type="bar-primary"></header-bar>

<div class="bar bar-subheader">
<div class="button-bar">
<a class="button">Success</a>
<a class="button">Warning</a>
<a class="button">Danger</a>
</div>
</div>

<content
has-header="false"
has-subheader="true"
has-footer="true"
overflow-scroll="true"
>

<div style="height: 3000px; width: 100%; background: url('tree_bark.png') repeat"></div>
</content>

<footer-bar type="bar-assertive">
<h1 class="title">Footer</h1>
</footer-bar>
</pane>
<side-menu side="left">
<header class="bar bar-header bar-assertive">
<h1 class="title">Left</h1>
</header>
<content has-header="true" overflow-scroll="true">
<ul class="list">
<a href="#" class="item" ng-repeat="item in list">
{{item.text}}
</a>
</ul>
</content>
</side-menu>
<side-menu side="right">
<header class="bar bar-header bar-assertive">
<h1 class="title">Right</h1>
</header>
<content has-header="true">
<ul class="list">
<a href="#" class="item" ng-repeat="item in list">
{{item.text}}
</a>
</ul>
</content>
</side-menu>
</side-menus>

<script>
angular.module('navTest', ['ionic'])

.controller('AppCtrl', function($scope, $compile, $timeout, $element) {
$scope.items = [];
for(var i = 0; i < 200; i++) {
$scope.items.push({
});
}
$scope.what = {};
$scope.onRefresh = function() {
console.log('On refresh');
$timeout(function() {
$scope.refreshComplete();
}, 2000);
}
$scope.onRefreshOpening = function(amt) {
console.log('On refresh opening', amt);
}

})
</script>
</body>
</html>

Binary file added js/ext/angular/test/tree_bark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c23369

Please sign in to comment.