diff --git a/src/pat/inject/inject.js b/src/pat/inject/inject.js index afe826ddb..17fffe0f9 100644 --- a/src/pat/inject/inject.js +++ b/src/pat/inject/inject.js @@ -309,7 +309,7 @@ const inject = { return true; }, - ensureTarget(cfg, $el) { + ensureTarget(cfg) { /* Make sure that a target element exists and that it's assigned to * cfg.$target. */ @@ -332,7 +332,7 @@ const inject = { return true; }, - verifySingleConfig($el, url, cfg) { + verifySingleConfig(url, cfg) { /* Verify one of potentially multiple configs (i.e. argument lists). * * Extract modifiers such as ::element or ::after. @@ -351,14 +351,14 @@ const inject = { if (!this.extractModifiers(cfg)) { return false; } - if (!this.ensureTarget(cfg, $el)) { + if (!this.ensureTarget(cfg)) { return false; } this.listenForFormReset(cfg); return true; }, - verifyConfig(cfgs, $el) { + verifyConfig(cfgs) { /* Verify and post-process all the configurations. * Each "config" is an arguments list separated by the && * combination operator. @@ -369,7 +369,7 @@ const inject = { * Verification for each cfg in the array needs to succeed. */ return cfgs.every( - _.partial(this.verifySingleConfig.bind(this), $el, cfgs[0].url) + _.partial(this.verifySingleConfig.bind(this), cfgs[0].url) ); }, @@ -735,7 +735,7 @@ const inject = { */ // get a kinda deep copy, we scribble on it cfgs = cfgs.map((cfg) => $.extend({}, cfg)); - if (!this.verifyConfig(cfgs, $el)) { + if (!this.verifyConfig(cfgs)) { return; } if (!this.askForConfirmation(cfgs)) { diff --git a/src/pat/inject/inject.test.js b/src/pat/inject/inject.test.js index 64ec3e7db..8f575f280 100644 --- a/src/pat/inject/inject.test.js +++ b/src/pat/inject/inject.test.js @@ -38,7 +38,7 @@ describe("pat-inject", function () { }, }; var cfgs = pattern.extractConfig($a, {}); - pattern.verifyConfig(cfgs, $a); + pattern.verifyConfig(cfgs); pattern._onInjectSuccess($a, cfgs, dummy_event); await utils.timeout(1); // wait a tick for async to settle. @@ -441,7 +441,7 @@ describe("pat-inject", function () { it("Use trigger as target", function () { $a.attr("data-pat-inject", "target: self::after"); var cfgs = pattern.extractConfig($a); - expect(pattern.verifyConfig(cfgs, $a)).toBeTruthy(); + expect(pattern.verifyConfig(cfgs)).toBeTruthy(); expect(cfgs[0].target).toBe("self"); expect(cfgs[0].$target[0]).toBe($a[0]); });