Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/pat/inject/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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)
);
},

Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/pat/inject/inject.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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]);
});
Expand Down