Permalink
Browse files

bug fix, update todo

  • Loading branch information...
yyx990803 committed Nov 18, 2012
1 parent 292446b commit 5e755c12f3c9313b8793c191a40d025e27da468d
Showing with 10 additions and 37 deletions.
  1. +2 −5 TODO.md
  2. +8 −1 js/collection.js
  3. +0 −31 js/touch.js
View
@@ -1,9 +1,6 @@
Create New Item
-- tap at empty space to create
+- tap at empty space to create (half done, still need the unfold animation when there's done items)
- pinch apart to create
Navigation
-- pinch inwards to close TodoCollection
-
-Bugs
-- Should disable dragging in edit state
+- pinch inwards to close TodoCollection
View
@@ -304,6 +304,7 @@ C.Collection = (function (raf) {
col.el.removeClass('drag');
col.inMomentum = false;
col.topDummy.hide();
+ if (col.bottomSwitch) col.bottomSwitch.hide();
}
function render () {
@@ -475,7 +476,13 @@ C.Collection = (function (raf) {
newItem.onEditStart();
}, true);
}, 1);
-
+
+ },
+
+ createItemInBetween: function () {
+
+
+
},
// listen for webkitTransitionEnd
View
@@ -181,55 +181,41 @@ C.touch = (function () {
var actions = {
- // TODO remove redundent logic in here
-
collectionDrag: {
check: function () {
-
if (Math.abs(touches[0].tdy) > dragThreshold) {
currentAction = 'collectionDrag';
C.currentCollection.onDragStart();
}
-
},
move: function () {
-
C.currentCollection.onDragMove(touches[0].dy);
-
},
end: function () {
-
var speed = touches[0].dy / touches[0].dt;
C.currentCollection.onDragEnd(speed);
-
}
},
itemDrag: {
check: function () {
-
if (touches[0].targetItem && Math.abs(touches[0].tdx) > dragThreshold) {
currentAction = 'itemDrag';
touches[0].targetItem.onDragStart();
}
-
},
move: function () {
-
touches[0].targetItem.onDragMove(touches[0].dx);
-
},
end: function () {
-
touches[0].targetItem.onDragEnd();
-
}
},
@@ -241,53 +227,40 @@ C.touch = (function () {
delay: 300,
startTimeout: function () {
-
this.timeOut = setTimeout(function () {
actions.itemSort.trigger();
}, this.delay);
-
},
move: function () {
-
touches[0].targetItem.onSortMove(touches[0].dy);
-
},
end: function () {
-
this.cancelTimeout();
touches[0].targetItem.onSortEnd();
-
},
trigger: function () {
-
this.timeOut = null;
if (currentAction) return;
-
currentAction = 'itemSort';
touches[0].targetItem.onSortStart();
-
},
cancelTimeout: function () {
-
if (this.timeOut) {
clearTimeout(this.timeOut);
this.timeOut = null;
}
-
}
},
pinch: {
start: function () {
-
currentAction = 'pinch';
-
},
move: function (i) {
@@ -303,19 +276,15 @@ C.touch = (function () {
itemTap: {
trigger: function (e) {
-
touches[0].targetItem.onTap(e);
-
}
},
collectionTap: {
trigger: function () {
-
C.currentCollection.onTap();
-
}
}

0 comments on commit 5e755c1

Please sign in to comment.