Skip to content

Commit ce44ef3

Browse files
committed
Test fix for #252
1 parent 65604ae commit ce44ef3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

dist/js/ionic.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -5756,6 +5756,7 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
57565756
* Toggle the left menu to open 100%
57575757
*/
57585758
toggleLeft: function() {
5759+
this.content.enableAnimation();
57595760
var openAmount = this.getOpenAmount();
57605761
if(openAmount > 0) {
57615762
this.openPercentage(0);
@@ -5768,6 +5769,7 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
57685769
* Toggle the right menu to open 100%
57695770
*/
57705771
toggleRight: function() {
5772+
this.content.enableAnimation();
57715773
var openAmount = this.getOpenAmount();
57725774
if(openAmount < 0) {
57735775
this.openPercentage(0);
@@ -5837,6 +5839,8 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
58375839
* negative value for right menu (only one menu will be visible at a time).
58385840
*/
58395841
openAmount: function(amount) {
5842+
console.log('OPEN AMOUNT', amount);
5843+
58405844
var maxLeft = this.left && this.left.width || 0;
58415845
var maxRight = this.right && this.right.width || 0;
58425846

@@ -5878,6 +5882,7 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
58785882
* @param {Event} e the gesture event to use for snapping
58795883
*/
58805884
snapToRest: function(e) {
5885+
console.log('SNAP TO REST');
58815886
// We want to animate at the end of this
58825887
this.content.enableAnimation();
58835888
this._isDragging = false;
@@ -5936,7 +5941,9 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
59365941

59375942
// End a drag with the given event
59385943
_endDrag: function(e) {
5939-
this.snapToRest(e);
5944+
if(this._isDragging) {
5945+
this.snapToRest(e);
5946+
}
59405947
this._startX = null;
59415948
this._lastX = null;
59425949
this._offsetX = null;

js/controllers/sideMenuController.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
* Toggle the left menu to open 100%
5454
*/
5555
toggleLeft: function() {
56+
this.content.enableAnimation();
5657
var openAmount = this.getOpenAmount();
5758
if(openAmount > 0) {
5859
this.openPercentage(0);
@@ -65,6 +66,7 @@
6566
* Toggle the right menu to open 100%
6667
*/
6768
toggleRight: function() {
69+
this.content.enableAnimation();
6870
var openAmount = this.getOpenAmount();
6971
if(openAmount < 0) {
7072
this.openPercentage(0);
@@ -134,6 +136,8 @@
134136
* negative value for right menu (only one menu will be visible at a time).
135137
*/
136138
openAmount: function(amount) {
139+
console.log('OPEN AMOUNT', amount);
140+
137141
var maxLeft = this.left && this.left.width || 0;
138142
var maxRight = this.right && this.right.width || 0;
139143

@@ -175,6 +179,7 @@
175179
* @param {Event} e the gesture event to use for snapping
176180
*/
177181
snapToRest: function(e) {
182+
console.log('SNAP TO REST');
178183
// We want to animate at the end of this
179184
this.content.enableAnimation();
180185
this._isDragging = false;
@@ -233,7 +238,9 @@
233238

234239
// End a drag with the given event
235240
_endDrag: function(e) {
236-
this.snapToRest(e);
241+
if(this._isDragging) {
242+
this.snapToRest(e);
243+
}
237244
this._startX = null;
238245
this._lastX = null;
239246
this._offsetX = null;

0 commit comments

Comments
 (0)