From 0f17f760db433b6552e88509473b85c598b0fbad Mon Sep 17 00:00:00 2001 From: John Carrell Date: Fri, 14 Jul 2017 16:04:22 -0500 Subject: [PATCH 1/4] Add Webstorm directory to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 642271f5..3a5d01a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -coverage/ \ No newline at end of file +coverage/ +.idea/ \ No newline at end of file From 9a2ae8fe2aec962292b3880e3fdd9fb04577a005 Mon Sep 17 00:00:00 2001 From: John Carrell Date: Fri, 14 Jul 2017 16:35:58 -0500 Subject: [PATCH 2/4] Correct whitespace --- awesomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesomplete.js b/awesomplete.js index 11c312f2..b0989b16 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -122,7 +122,7 @@ _.prototype = { this._list = list; } else if (typeof list === "string" && list.indexOf(",") > -1) { - this._list = list.split(/\s*,\s*/); + this._list = list.split(/\s*,\s*/); } else { // Element or CSS selector list = $(list); From 383dab7a6633686a182e4f1fdc4602ddc0370ee9 Mon Sep 17 00:00:00 2001 From: John Carrell Date: Fri, 14 Jul 2017 16:36:09 -0500 Subject: [PATCH 3/4] Disallow multiple dropdowns on evaluate() --- awesomplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awesomplete.js b/awesomplete.js index b0989b16..7470f8af 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -292,7 +292,9 @@ _.prototype = { if (this.ul.children.length === 0) { this.close({ reason: "nomatches" }); } else { - this.open(); + // If the dropdown is already open, don't open again. + if (!this.isOpened) + this.open(); } } else { From be44dc69e156cbfcdd69c944c3c190ba453e7eaf Mon Sep 17 00:00:00 2001 From: John Carrell Date: Mon, 17 Jul 2017 08:29:05 -0500 Subject: [PATCH 4/4] Update unit test. --- test/api/evaluateSpec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/api/evaluateSpec.js b/test/api/evaluateSpec.js index b8107bb3..a0b8ebbd 100644 --- a/test/api/evaluateSpec.js +++ b/test/api/evaluateSpec.js @@ -45,7 +45,8 @@ describe("awesomplete.evaluate", function () { spyOn(this.subject, "open"); this.subject.evaluate(); - expect(this.subject.open).toHaveBeenCalled(); + if (!this.subject.isOpened) + expect(this.subject.open).toHaveBeenCalled(); }); it("fills completer with found items", function () {