Test fix for #252

This commit is contained in:
Max Lynch
2013-12-15 11:34:12 -06:00
parent 65604aebf5
commit ce44ef3930
2 changed files with 16 additions and 2 deletions

9
dist/js/ionic.js vendored
View File

@@ -5756,6 +5756,7 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
* Toggle the left menu to open 100%
*/
toggleLeft: function() {
this.content.enableAnimation();
var openAmount = this.getOpenAmount();
if(openAmount > 0) {
this.openPercentage(0);
@@ -5768,6 +5769,7 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
* Toggle the right menu to open 100%
*/
toggleRight: function() {
this.content.enableAnimation();
var openAmount = this.getOpenAmount();
if(openAmount < 0) {
this.openPercentage(0);
@@ -5837,6 +5839,8 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
* negative value for right menu (only one menu will be visible at a time).
*/
openAmount: function(amount) {
console.log('OPEN AMOUNT', amount);
var maxLeft = this.left && this.left.width || 0;
var maxRight = this.right && this.right.width || 0;
@@ -5878,6 +5882,7 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
* @param {Event} e the gesture event to use for snapping
*/
snapToRest: function(e) {
console.log('SNAP TO REST');
// We want to animate at the end of this
this.content.enableAnimation();
this._isDragging = false;
@@ -5936,7 +5941,9 @@ ionic.controllers.NavController = ionic.controllers.ViewController.inherit({
// End a drag with the given event
_endDrag: function(e) {
this.snapToRest(e);
if(this._isDragging) {
this.snapToRest(e);
}
this._startX = null;
this._lastX = null;
this._offsetX = null;

View File

@@ -53,6 +53,7 @@
* Toggle the left menu to open 100%
*/
toggleLeft: function() {
this.content.enableAnimation();
var openAmount = this.getOpenAmount();
if(openAmount > 0) {
this.openPercentage(0);
@@ -65,6 +66,7 @@
* Toggle the right menu to open 100%
*/
toggleRight: function() {
this.content.enableAnimation();
var openAmount = this.getOpenAmount();
if(openAmount < 0) {
this.openPercentage(0);
@@ -134,6 +136,8 @@
* negative value for right menu (only one menu will be visible at a time).
*/
openAmount: function(amount) {
console.log('OPEN AMOUNT', amount);
var maxLeft = this.left && this.left.width || 0;
var maxRight = this.right && this.right.width || 0;
@@ -175,6 +179,7 @@
* @param {Event} e the gesture event to use for snapping
*/
snapToRest: function(e) {
console.log('SNAP TO REST');
// We want to animate at the end of this
this.content.enableAnimation();
this._isDragging = false;
@@ -233,7 +238,9 @@
// End a drag with the given event
_endDrag: function(e) {
this.snapToRest(e);
if(this._isDragging) {
this.snapToRest(e);
}
this._startX = null;
this._lastX = null;
this._offsetX = null;