From 98621881b41a199bc9ac9f8cd7cfbe05dc3a2cf3 Mon Sep 17 00:00:00 2001 From: Zachary Vance Date: Wed, 27 May 2015 17:51:11 -0700 Subject: [PATCH] Can't combined two nodes if the second is completed --- dist/flowy.js | 6 ++++++ dist/flowy.unwrapped.js | 6 ++++++ src/views/todo.js | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/dist/flowy.js b/dist/flowy.js index 8e202cd..fefa3a4 100644 --- a/dist/flowy.js +++ b/dist/flowy.js @@ -504,6 +504,9 @@ var TodoView = Backbone.View.extend({ if (this.model.hasChildren()) { return; } + if (this.model.get("completed")) { + return; + } var previousNode = this.model.previousNode(); if (!previousNode) { return; @@ -528,6 +531,9 @@ var TodoView = Backbone.View.extend({ if (!nextNode) { return; } + if (nextNode.model.get("completed")) { + return; + } if (this.model.get("text") === "") { this.model.remove(); nextNode.getView().startEditingText(); diff --git a/dist/flowy.unwrapped.js b/dist/flowy.unwrapped.js index 686f1bb..20777ee 100644 --- a/dist/flowy.unwrapped.js +++ b/dist/flowy.unwrapped.js @@ -503,6 +503,9 @@ var TodoView = Backbone.View.extend({ if (this.model.hasChildren()) { return; } + if (this.model.get("completed")) { + return; + } var previousNode = this.model.previousNode(); if (!previousNode) { return; @@ -527,6 +530,9 @@ var TodoView = Backbone.View.extend({ if (!nextNode) { return; } + if (nextNode.model.get("completed")) { + return; + } if (this.model.get("text") === "") { this.model.remove(); nextNode.getView().startEditingText(); diff --git a/src/views/todo.js b/src/views/todo.js index 9dc97a9..f5df801 100644 --- a/src/views/todo.js +++ b/src/views/todo.js @@ -107,6 +107,9 @@ var TodoView = Backbone.View.extend({ if (this.model.hasChildren()) { return; } + if (this.model.get("completed")) { + return; + } var previousNode = this.model.previousNode(); if (!previousNode) { return; @@ -131,6 +134,9 @@ var TodoView = Backbone.View.extend({ if (!nextNode) { return; } + if (nextNode.model.get("completed")) { + return; + } if (this.model.get("text") === "") { this.model.remove(); nextNode.getView().startEditingText(); -- 2.47.3