From: Zachary Vance Date: Thu, 28 May 2015 00:51:11 +0000 (-0700) Subject: Can't combined two nodes if the second is completed X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=98621881b41a199bc9ac9f8cd7cfbe05dc3a2cf3;p=flowy.git Can't combined two nodes if the second is completed --- 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();