if (!next) return false;
next.getView().startEditingText();
}
- return false; // Don't propogate
+ return false;
},
next: function() {
var nextNode = this.model.nextNode(this.model.collection, { childrenAllowed: true });
},
expand: function() {
console.log("Expand not implemented"); // TODO
+ this.model.toggleCollapsed(); // TODO: Display change
+ return false;
},
zoomIn: function() {
console.log("Zoom not implemented"); // TODO
this.stopEditingText();
emptyBefore.getView().startEditingText();
} else if (lines.length === 2) { // Line break in middle
- var newNode = this.model.addTodoBefore({text: this.decodeText(lines[0])}, collection);
- this.model.setText(this.decodeText(lines[1]));
+ var newNode = this.model.addTodoAfter({text: this.decodeText(lines[1])}, collection);
+ this.model.setText(this.decodeText(lines[0]));
this.stopEditingText(); // For re-render
- this.startEditingText(); // Keep focus on current node (second half)
+ newNode.getView().startEditingText(); // Keep focus on current node (second half)
} else if (lines.length > 2) {
console.log(lines.length);
console.log($(e.target).html());
if (!next) return false;
next.getView().startEditingText();
}
- return false; // Don't propogate
+ return false;
},
next: function() {
var nextNode = this.model.nextNode(this.model.collection, { childrenAllowed: true });
},
expand: function() {
console.log("Expand not implemented"); // TODO
+ this.model.toggleCollapsed(); // TODO: Display change
+ return false;
},
zoomIn: function() {
console.log("Zoom not implemented"); // TODO
this.stopEditingText();
emptyBefore.getView().startEditingText();
} else if (lines.length === 2) { // Line break in middle
- var newNode = this.model.addTodoBefore({text: this.decodeText(lines[0])}, collection);
- this.model.setText(this.decodeText(lines[1]));
+ var newNode = this.model.addTodoAfter({text: this.decodeText(lines[1])}, collection);
+ this.model.setText(this.decodeText(lines[0]));
this.stopEditingText(); // For re-render
- this.startEditingText(); // Keep focus on current node (second half)
+ newNode.getView().startEditingText(); // Keep focus on current node (second half)
} else if (lines.length > 2) {
console.log(lines.length);
console.log($(e.target).html());
if (!next) return false;
next.getView().startEditingText();
}
- return false; // Don't propogate
+ return false;
},
next: function() {
var nextNode = this.model.nextNode(this.model.collection, { childrenAllowed: true });
},
expand: function() {
console.log("Expand not implemented"); // TODO
+ this.model.toggleCollapsed(); // TODO: Display change
+ return false;
},
zoomIn: function() {
console.log("Zoom not implemented"); // TODO
this.stopEditingText();
emptyBefore.getView().startEditingText();
} else if (lines.length === 2) { // Line break in middle
- var newNode = this.model.addTodoBefore({text: this.decodeText(lines[0])}, collection);
- this.model.setText(this.decodeText(lines[1]));
+ var newNode = this.model.addTodoAfter({text: this.decodeText(lines[1])}, collection);
+ this.model.setText(this.decodeText(lines[0]));
this.stopEditingText(); // For re-render
- this.startEditingText(); // Keep focus on current node (second half)
+ newNode.getView().startEditingText(); // Keep focus on current node (second half)
} else if (lines.length > 2) {
console.log(lines.length);
console.log($(e.target).html());