Skip to content

Commit 411653d

Browse files
committed
maint(pat-inject): Remove obsolete hooks option.
The hooks option allowed to throw custom events after successful injection. It was a multi-value argument but only allowed "raptor" as value. Raptor was a WYSIWYG editor which has not been further developed since 10 years and which we're not supporting anymore since quite some time. Thus this option could be safely removed and this change is not a breaking change. If you need to react on events, see the documented event list in pat-inject's documentation.
1 parent 7b26f26 commit 411653d

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

src/pat/inject/documentation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ You can customise the behaviour of injection through options in the `data-pat-in
372372
| `class` | | | A class which will be added to the injected content. Multiple classes can be specified (separated with spaces). | String |
373373
| `loading-class` | 'injecting' | | A class which will be added to the injection target while content is still being loaded. Multiple classes can be specified (separated with spaces), or leave empty if no class should be added. | String |
374374
| `history` | | `none` `record` | If set to `record` then injection will update the URL history and the title tag of the HTML page. | String or null. |
375-
| `hooks` | `[]` | `["raptor"]` | Once injection has completed successfully, pat-inject will trigger an event for each hook: pat-inject-hook-\$(hook). Useful for other patterns which need to know whether injection relevant to them has finished, for example `pat-raptor`. | String. |
376375
| `scroll` | | `none`, `top`, `target`, CSS selector | After injection is done, scroll to to given position. The default or `none` is to not do any scrolling. `top` scrolls to the top of the scroll container. `target` scrolls to the pat-inject target. CSS selector scrolls to the given selector. Note: You have to define a scroll container by setting overflow classes, otherwise `window` is used. | String, CSS selector |
377376

378377

src/pat/inject/inject.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ parser.addArgument("delay"); // only used in autoload
3030
parser.addArgument("browser-cache", "no-cache", ["cache", "no-cache"]); // Cache ajax requests. Pass to pat-ajax.
3131
parser.addArgument("confirm", "class", ["never", "always", "form-data", "class"]);
3232
parser.addArgument("confirm-message", "Are you sure you want to leave this page?");
33-
parser.addArgument("hooks", [], ["raptor"], true); // After injection, pat-inject will trigger an event for each hook: pat-inject-hook-$(hook)
3433
parser.addArgument("loading-class", "injecting"); // Add a class to the target while content is still loading.
3534
parser.addArgument("executing-class", "executing"); // Add a class to the element while content is still loading.
3635
parser.addArgument("executed-class", "executed"); // Add a class to the element when content is loaded.
@@ -562,9 +561,6 @@ const inject = {
562561
// Special case, we want to call something, but we don't want to inject anything
563562
data = "";
564563
}
565-
$.each(cfgs[0].hooks || [], (idx, hook) =>
566-
$el.trigger("pat-inject-hook-" + hook)
567-
);
568564
const sources$ = await this.callTypeHandler(cfgs[0].dataType, "sources", $el, [
569565
cfgs,
570566
data,

0 commit comments

Comments
 (0)