#todo-list {
width: 80%;
}
+#todo-list > .todo {
+ /* Root doesn't get displayed */
+}
+#todo-list > .todo > .text {
+ display: none;
+}
+#todo-list > .todo > .bullets > .todo {
+ margin-left: 0px;
+}
.with-dropshadow {
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
},
outdent: function() {
// After parent, then nothing
+ var parent = this.getParent();
+ if (! parent || parent.isRoot()) return undefined;
+ var grandparent = parent.getParent();
+ return this.moveTo({
+ parent: grandparent,
+ index: grandparent.findChild(parent.id)+1,
+ });
},
isRoot: function() {
return this.id === this.collection.rootId;
];
var todos = new FlowyDocModel({
-});
+rootId: 0});
var appDefaults = { list: todos };
var AppView = Backbone.View.extend({
return;
}
var view = new TodoView({model: todo});
- if (todo.isTopLevel()) {
+ if (todo.isRoot()) {
this.setView(todo, view);
this.$("#todo-list").append(view.render().el);
} else if (todo.isParentLoaded(this) && todo.getParent().findChild(todo.id) >= 0 /* because move/insert is nonatomic */) {
},
outdent: function() {
// After parent, then nothing
+ var parent = this.getParent();
+ if (! parent || parent.isRoot()) return undefined;
+ var grandparent = parent.getParent();
+ return this.moveTo({
+ parent: grandparent,
+ index: grandparent.findChild(parent.id)+1,
+ });
},
isRoot: function() {
return this.id === this.collection.rootId;
];
var todos = new FlowyDocModel({
-});
+rootId: 0});
var appDefaults = { list: todos };
var AppView = Backbone.View.extend({
return;
}
var view = new TodoView({model: todo});
- if (todo.isTopLevel()) {
+ if (todo.isRoot()) {
this.setView(todo, view);
this.$("#todo-list").append(view.render().el);
} else if (todo.isParentLoaded(this) && todo.getParent().findChild(todo.id) >= 0 /* because move/insert is nonatomic */) {
#todo-list {
width: 80%;
+ > .todo { /* Root doesn't get displayed */
+ > .text {
+ display: none;
+ }
+ > .bullets > .todo {
+ margin-left: 0px;
+ }
+ }
}
.with-dropshadow {
},
outdent: function() {
// After parent, then nothing
+ var parent = this.getParent();
+ if (! parent || parent.isRoot()) return undefined;
+ var grandparent = parent.getParent();
+ return this.moveTo({
+ parent: grandparent,
+ index: grandparent.findChild(parent.id)+1,
+ });
},
isRoot: function() {
return this.id === this.collection.rootId;
];
var todos = new FlowyDocModel({
-});
+rootId: 0});
var appDefaults = { list: todos };
var AppView = Backbone.View.extend({
return;
}
var view = new TodoView({model: todo});
- if (todo.isTopLevel()) {
+ if (todo.isRoot()) {
this.setView(todo, view);
this.$("#todo-list").append(view.render().el);
} else if (todo.isParentLoaded(this) && todo.getParent().findChild(todo.id) >= 0 /* because move/insert is nonatomic */) {