diff options
-rw-r--r-- | .eslintrc | 3 | ||||
-rw-r--r-- | awesomplete.js | 12 | ||||
-rw-r--r-- | test/api/closeSpec.js | 2 | ||||
-rw-r--r-- | test/api/evaluateSpec.js | 4 | ||||
-rw-r--r-- | test/api/selectSpec.js | 2 | ||||
-rw-r--r-- | test/events/blurSpec.js | 4 | ||||
-rw-r--r-- | test/events/keydownSpec.js | 2 | ||||
-rw-r--r-- | test/events/submitSpec.js | 4 |
8 files changed, 17 insertions, 16 deletions
@@ -206,8 +206,9 @@ rules: prefer-reflect: 0 quote-props: 0 quotes: - - 0 + - 2 - double + - avoid-escape radix: 0 require-yield: 0 semi: 0 diff --git a/awesomplete.js b/awesomplete.js index 48c9e4b..939eabb 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -55,7 +55,7 @@ var _ = function (input, o) { $.bind(this.input, { "input": this.evaluate.bind(this), - "blur": this.close.bind(this, { reason: 'blur' }), + "blur": this.close.bind(this, { reason: "blur" }), "keydown": function(evt) { var c = evt.keyCode; @@ -67,7 +67,7 @@ var _ = function (input, o) { me.select(); } else if (c === 27) { // Esc - me.close({ reason: 'esc' }); + me.close({ reason: "esc" }); } else if (c === 38 || c === 40) { // Down/Up arrow evt.preventDefault(); @@ -77,7 +77,7 @@ var _ = function (input, o) { } }); - $.bind(this.input.form, {"submit": this.close.bind(this, { reason: 'submit' })}); + $.bind(this.input.form, {"submit": this.close.bind(this, { reason: "submit" })}); $.bind(this.ul, {"mousedown": function(evt) { var li = evt.target; @@ -216,7 +216,7 @@ _.prototype = { if (allowed) { this.replace(suggestion); - this.close({ reason: 'select' }); + this.close({ reason: "select" }); $.fire(this.input, "awesomplete-selectcomplete", { text: suggestion }); @@ -248,13 +248,13 @@ _.prototype = { }); if (this.ul.children.length === 0) { - this.close({ reason: 'nomatches' }); + this.close({ reason: "nomatches" }); } else { this.open(); } } else { - this.close({ reason: 'nomatches' }); + this.close({ reason: "nomatches" }); } } }; diff --git a/test/api/closeSpec.js b/test/api/closeSpec.js index a39687c..ae1bea0 100644 --- a/test/api/closeSpec.js +++ b/test/api/closeSpec.js @@ -25,7 +25,7 @@ describe("awesomplete.close", function () { this.subject.close(); expect(handler).toHaveBeenCalledWith( - jasmine.any(document.createEvent('HTMLEvents').constructor) + jasmine.any(document.createEvent("HTMLEvents").constructor) ); }); diff --git a/test/api/evaluateSpec.js b/test/api/evaluateSpec.js index 95d1c6d..b8107bb 100644 --- a/test/api/evaluateSpec.js +++ b/test/api/evaluateSpec.js @@ -16,7 +16,7 @@ describe("awesomplete.evaluate", function () { this.subject.evaluate(); expect(this.subject.close).toHaveBeenCalledWith({ - reason: 'nomatches' + reason: "nomatches" }); }); }); @@ -31,7 +31,7 @@ describe("awesomplete.evaluate", function () { this.subject.evaluate(); expect(this.subject.close).toHaveBeenCalledWith({ - reason: 'nomatches' + reason: "nomatches" }); }); }); diff --git a/test/api/selectSpec.js b/test/api/selectSpec.js index 4224301..f9fd2c9 100644 --- a/test/api/selectSpec.js +++ b/test/api/selectSpec.js @@ -67,7 +67,7 @@ describe("awesomplete.select", function () { this.subject.select(this.selectArgument); expect(this.subject.close).toHaveBeenCalledWith({ - reason: 'select' + reason: "select" }); }); diff --git a/test/events/blurSpec.js b/test/events/blurSpec.js index cf5b7be..77d6f38 100644 --- a/test/events/blurSpec.js +++ b/test/events/blurSpec.js @@ -8,8 +8,8 @@ describe("blur event", function () { spyOn(Awesomplete.prototype, "close"); $.fire(this.subject.input, "blur"); expect(Awesomplete.prototype.close).toHaveBeenCalledWith( - { reason: 'blur' }, - jasmine.any(document.createEvent('HTMLEvents').constructor) + { reason: "blur" }, + jasmine.any(document.createEvent("HTMLEvents").constructor) ); }); }); diff --git a/test/events/keydownSpec.js b/test/events/keydownSpec.js index c34941b..72dcdf5 100644 --- a/test/events/keydownSpec.js +++ b/test/events/keydownSpec.js @@ -24,7 +24,7 @@ describe("keydown event", function () { $.keydown(this.subject.input, $.k.ESC); expect(this.subject.close).toHaveBeenCalledWith({ - reason: 'esc' + reason: "esc" }); }); diff --git a/test/events/submitSpec.js b/test/events/submitSpec.js index 619ec82..2e55744 100644 --- a/test/events/submitSpec.js +++ b/test/events/submitSpec.js @@ -10,8 +10,8 @@ describe("form submit event", function () { $.on(this.subject.input.form, "submit", function (evt) { evt.preventDefault() }); $.fire(this.subject.input.form, "submit"); expect(Awesomplete.prototype.close).toHaveBeenCalledWith( - { reason: 'submit' }, - jasmine.any(document.createEvent('HTMLEvents').constructor) + { reason: "submit" }, + jasmine.any(document.createEvent("HTMLEvents").constructor) ); }); }); |