]> git.za3k.com Git - flowy.git/commitdiff
Can't combined two nodes if the second is completed
authorZachary Vance <vanceza@gmail.com>
Thu, 28 May 2015 00:51:11 +0000 (17:51 -0700)
committerZachary Vance <vanceza@gmail.com>
Thu, 28 May 2015 00:51:11 +0000 (17:51 -0700)
dist/flowy.js
dist/flowy.unwrapped.js
src/views/todo.js

index 8e202cdff9e39c9fd71574f0edf8701d9f02895c..fefa3a464162aea2b08c23cab8f9f5c29966f412 100644 (file)
@@ -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();
index 686f1bbf7a34567d09fd1df0f4380b311a95e747..20777ee66bdec48a04b2fa192059ac12ace7542c 100644 (file)
@@ -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();
index 9dc97a99f42404431cc4d41192b356a8b6037d92..f5df8010cd9a06963c0b2b43fda955a8a08c0004 100644 (file)
@@ -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();