]> git.za3k.com Git - flowy.git/commitdiff
Clean up empty string code style
authorZachary Vance <vanceza@gmail.com>
Wed, 27 May 2015 00:26:18 +0000 (17:26 -0700)
committerZachary Vance <vanceza@gmail.com>
Wed, 27 May 2015 00:26:18 +0000 (17:26 -0700)
dist/flowy.js
dist/flowy.unwrapped.js
src/views/todo.js

index dac4809e8d753a7b68d60d7017af12a8c05db1ae..230d67b7babf8ee22a3261c627f245be4c4e8392 100644 (file)
@@ -579,12 +579,12 @@ var TodoView = Backbone.View.extend({
         this.model.setText(this.decodeText(lines[0]));
         this.stopEditingText();
         this.outdent();
-     } else if ((lines.length === 2 && lines[1].length === 0) || (lines.length === 3 && lines[1].length === 0 && lines[2].length === 0)) { // Line break at end
+     } else if ((lines.length === 2 && lines[1] === "") || (lines.length === 3 && lines[1] === "" && lines[2] === "")) { // Line break at end
         this.model.setText(this.decodeText(lines[0]));
         var emptyAfter = this.model.addTodoAfter({text: this.decodeText(lines[1])}, collection); // Child or not depending on whether this has children
         this.stopEditingText();
         emptyAfter.getView().startEditingText();
-     } else if (lines.length === 2 && lines[0].length === 0) { // Line break at beginning
+     } else if (lines.length === 2 && lines[0] === "") { // Line break at beginning
         var emptyBefore = this.model.addTodoBefore({text: this.decodeText(lines[0])}, collection);
         this.model.setText(this.decodeText(lines[1]));
         this.stopEditingText();
index 64385a6b3c8f7ddb31b65ad3bbd6d344338857fa..fce3cbc43e0ef86f42c165d6d66459f5b6790746 100644 (file)
@@ -578,12 +578,12 @@ var TodoView = Backbone.View.extend({
         this.model.setText(this.decodeText(lines[0]));
         this.stopEditingText();
         this.outdent();
-     } else if ((lines.length === 2 && lines[1].length === 0) || (lines.length === 3 && lines[1].length === 0 && lines[2].length === 0)) { // Line break at end
+     } else if ((lines.length === 2 && lines[1] === "") || (lines.length === 3 && lines[1] === "" && lines[2] === "")) { // Line break at end
         this.model.setText(this.decodeText(lines[0]));
         var emptyAfter = this.model.addTodoAfter({text: this.decodeText(lines[1])}, collection); // Child or not depending on whether this has children
         this.stopEditingText();
         emptyAfter.getView().startEditingText();
-     } else if (lines.length === 2 && lines[0].length === 0) { // Line break at beginning
+     } else if (lines.length === 2 && lines[0] === "") { // Line break at beginning
         var emptyBefore = this.model.addTodoBefore({text: this.decodeText(lines[0])}, collection);
         this.model.setText(this.decodeText(lines[1]));
         this.stopEditingText();
index 405464f75b16055a18909771eb3fd04b3a983d3f..a7a48f08d8d2bbe94787b287dc5de7a6bfee84fc 100644 (file)
@@ -187,12 +187,12 @@ var TodoView = Backbone.View.extend({
         this.model.setText(this.decodeText(lines[0]));
         this.stopEditingText();
         this.outdent();
-     } else if ((lines.length === 2 && lines[1].length === 0) || (lines.length === 3 && lines[1].length === 0 && lines[2].length === 0)) { // Line break at end
+     } else if ((lines.length === 2 && lines[1] === "") || (lines.length === 3 && lines[1] === "" && lines[2] === "")) { // Line break at end
         this.model.setText(this.decodeText(lines[0]));
         var emptyAfter = this.model.addTodoAfter({text: this.decodeText(lines[1])}, collection); // Child or not depending on whether this has children
         this.stopEditingText();
         emptyAfter.getView().startEditingText();
-     } else if (lines.length === 2 && lines[0].length === 0) { // Line break at beginning
+     } else if (lines.length === 2 && lines[0] === "") { // Line break at beginning
         var emptyBefore = this.model.addTodoBefore({text: this.decodeText(lines[0])}, collection);
         this.model.setText(this.decodeText(lines[1]));
         this.stopEditingText();