From 24259b78b9db9c0f404507a2c79b6adfc528653b Mon Sep 17 00:00:00 2001 From: Zachary Vance Date: Tue, 26 May 2015 17:26:18 -0700 Subject: [PATCH] Clean up empty string code style --- dist/flowy.js | 4 ++-- dist/flowy.unwrapped.js | 4 ++-- src/views/todo.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/flowy.js b/dist/flowy.js index dac4809..230d67b 100644 --- a/dist/flowy.js +++ b/dist/flowy.js @@ -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(); diff --git a/dist/flowy.unwrapped.js b/dist/flowy.unwrapped.js index 64385a6..fce3cbc 100644 --- a/dist/flowy.unwrapped.js +++ b/dist/flowy.unwrapped.js @@ -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(); diff --git a/src/views/todo.js b/src/views/todo.js index 405464f..a7a48f0 100644 --- a/src/views/todo.js +++ b/src/views/todo.js @@ -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(); -- 2.47.3