padding-right: 60px;
padding-left: 60px;
background: #ffffff;
+ min-height: 552px;
}
.todo > .text {
font-size: 20pt;
'Shortcut("toggleComplete", "Complete", "ctrl+enter") > .text': "toggleComplete",
'Shortcut("backspace", "Combine an item with the previous item", "backspace") > .text': "backspace",
'Shortcut("delete", "Combine an item with the next item", "del") > .text': "delete",
- //'Shortcut("next", "Next", "down") > .text': 'next',
- //'Shortcut("previous", "Previous", "previous") > .text': 'previous',
-
+ 'Shortcut("next", "Next", "down") > .text': 'next',
+ 'Shortcut("previous", "Previous", "up") > .text': 'previous',
},
initialize: function() {
this.childViewPositions = [];
} else {
this.stopEditingText();
this.model.toggleComplete();
- var next = this.model.nextNode(this.model.collection, {"childrenAllowed":false});
+ var next = this.model.nextNode(this.model.collection, {"childrenAllowed":false}) || this.model.getParent(this.model.collection);
if (!next) return false;
next.getView().startEditingText();
}
return false; // Don't propogate
},
+ next: function() {
+ var nextNode = this.model.nextNode(this.model.collection, { childrenAllowed: true });
+ if (!nextNode) return false;
+ this.stopEditingText();
+ nextNode.getView().startEditingText();
+ return false;
+ },
+ previous: function() {
+ var previousNode = this.model.previousNode(this.model.collection, { childrenAllowed: true });
+ if (!previousNode) return false;
+ this.stopEditingText();
+ previousNode.getView().startEditingText();
+ return false;
+ },
backspace: function() {
if (this.model.hasChildren()) {
return;
return parent.getChild(collection, index + 1);
},
nextNode: function(collection, options) {
- options = _.defaults({}, options, {"childrenAllowed": true});
+ options = _.defaults({}, options, {childrenAllowed: true});
if (options.childrenAllowed) {
if (this.hasChildren()) {
return this.getChild(collection, 0);
}
return undefined;
},
- previousNode: function(collection) {
- var previous = this.getPreviousSibling(collection) || this.getParent(collection);
+ previousNode: function(collection, options) {
+ options = _.defaults({}, options, {childrenAllowed: true});
+ var previous = this.getPreviousSibling(collection);
+ if (previous && options.childrenAllowed) {
+ while (previous.hasChildren()) {
+ previous = previous.getChild(collection, previous.getChildrenCount() - 1);
+ }
+ }
+ if (!previous) previous = this.getParent(collection);
+ if (!previous) return undefined;
if (previous.id === collection.rootId) {
return undefined;
} else {
parent: 0,
id: 5,
text: "To do this year",
- collapsed: true,
+ collapsed: false,
bullets: [6],
}),
new TodoModel({
e.save();
});
});
- Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete'] });
+ Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete', 'next', 'previous'] });
this.views = {}; // A list of views for each element in the collection
this.list.fetch();
this.render();
'Shortcut("toggleComplete", "Complete", "ctrl+enter") > .text': "toggleComplete",
'Shortcut("backspace", "Combine an item with the previous item", "backspace") > .text': "backspace",
'Shortcut("delete", "Combine an item with the next item", "del") > .text': "delete",
- //'Shortcut("next", "Next", "down") > .text': 'next',
- //'Shortcut("previous", "Previous", "previous") > .text': 'previous',
-
+ 'Shortcut("next", "Next", "down") > .text': 'next',
+ 'Shortcut("previous", "Previous", "up") > .text': 'previous',
},
initialize: function() {
this.childViewPositions = [];
} else {
this.stopEditingText();
this.model.toggleComplete();
- var next = this.model.nextNode(this.model.collection, {"childrenAllowed":false});
+ var next = this.model.nextNode(this.model.collection, {"childrenAllowed":false}) || this.model.getParent(this.model.collection);
if (!next) return false;
next.getView().startEditingText();
}
return false; // Don't propogate
},
+ next: function() {
+ var nextNode = this.model.nextNode(this.model.collection, { childrenAllowed: true });
+ if (!nextNode) return false;
+ this.stopEditingText();
+ nextNode.getView().startEditingText();
+ return false;
+ },
+ previous: function() {
+ var previousNode = this.model.previousNode(this.model.collection, { childrenAllowed: true });
+ if (!previousNode) return false;
+ this.stopEditingText();
+ previousNode.getView().startEditingText();
+ return false;
+ },
backspace: function() {
if (this.model.hasChildren()) {
return;
return parent.getChild(collection, index + 1);
},
nextNode: function(collection, options) {
- options = _.defaults({}, options, {"childrenAllowed": true});
+ options = _.defaults({}, options, {childrenAllowed: true});
if (options.childrenAllowed) {
if (this.hasChildren()) {
return this.getChild(collection, 0);
}
return undefined;
},
- previousNode: function(collection) {
- var previous = this.getPreviousSibling(collection) || this.getParent(collection);
+ previousNode: function(collection, options) {
+ options = _.defaults({}, options, {childrenAllowed: true});
+ var previous = this.getPreviousSibling(collection);
+ if (previous && options.childrenAllowed) {
+ while (previous.hasChildren()) {
+ previous = previous.getChild(collection, previous.getChildrenCount() - 1);
+ }
+ }
+ if (!previous) previous = this.getParent(collection);
+ if (!previous) return undefined;
if (previous.id === collection.rootId) {
return undefined;
} else {
parent: 0,
id: 5,
text: "To do this year",
- collapsed: true,
+ collapsed: false,
bullets: [6],
}),
new TodoModel({
e.save();
});
});
- Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete'] });
+ Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete', 'next', 'previous'] });
this.views = {}; // A list of views for each element in the collection
this.list.fetch();
this.render();
padding-right: 60px;
padding-left: 60px;
background: #ffffff;
+ min-height: 552px;
}
.todo > .text {
return parent.getChild(collection, index + 1);
},
nextNode: function(collection, options) {
- options = _.defaults({}, options, {"childrenAllowed": true});
+ options = _.defaults({}, options, {childrenAllowed: true});
if (options.childrenAllowed) {
if (this.hasChildren()) {
return this.getChild(collection, 0);
}
return undefined;
},
- previousNode: function(collection) {
- var previous = this.getPreviousSibling(collection) || this.getParent(collection);
+ previousNode: function(collection, options) {
+ options = _.defaults({}, options, {childrenAllowed: true});
+ var previous = this.getPreviousSibling(collection);
+ if (previous && options.childrenAllowed) {
+ while (previous.hasChildren()) {
+ previous = previous.getChild(collection, previous.getChildrenCount() - 1);
+ }
+ }
+ if (!previous) previous = this.getParent(collection);
+ if (!previous) return undefined;
if (previous.id === collection.rootId) {
return undefined;
} else {
parent: 0,
id: 5,
text: "To do this year",
- collapsed: true,
+ collapsed: false,
bullets: [6],
}),
new TodoModel({
e.save();
});
});
- Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete'] });
+ Shortcut.bindShortcutsDisplay(this.$("#shortcuts-wrapper")[0], {allowRebind: true, noDisplay: ['backspace', 'delete', 'next', 'previous'] });
this.views = {}; // A list of views for each element in the collection
this.list.fetch();
this.render();
'Shortcut("toggleComplete", "Complete", "ctrl+enter") > .text': "toggleComplete",
'Shortcut("backspace", "Combine an item with the previous item", "backspace") > .text': "backspace",
'Shortcut("delete", "Combine an item with the next item", "del") > .text': "delete",
- //'Shortcut("next", "Next", "down") > .text': 'next',
- //'Shortcut("previous", "Previous", "previous") > .text': 'previous',
-
+ 'Shortcut("next", "Next", "down") > .text': 'next',
+ 'Shortcut("previous", "Previous", "up") > .text': 'previous',
},
initialize: function() {
this.childViewPositions = [];
} else {
this.stopEditingText();
this.model.toggleComplete();
- var next = this.model.nextNode(this.model.collection, {"childrenAllowed":false});
+ var next = this.model.nextNode(this.model.collection, {"childrenAllowed":false}) || this.model.getParent(this.model.collection);
if (!next) return false;
next.getView().startEditingText();
}
return false; // Don't propogate
},
+ next: function() {
+ var nextNode = this.model.nextNode(this.model.collection, { childrenAllowed: true });
+ if (!nextNode) return false;
+ this.stopEditingText();
+ nextNode.getView().startEditingText();
+ return false;
+ },
+ previous: function() {
+ var previousNode = this.model.previousNode(this.model.collection, { childrenAllowed: true });
+ if (!previousNode) return false;
+ this.stopEditingText();
+ previousNode.getView().startEditingText();
+ return false;
+ },
backspace: function() {
if (this.model.hasChildren()) {
return;