X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9135a85de4eef32a91c7a3ee0aa405ed454e5a4c..refs/pull/4969/head:/dev/docs/javascript-code.md diff --git a/dev/docs/javascript-code.md b/dev/docs/javascript-code.md index a1092ce92..ba7d79972 100644 --- a/dev/docs/javascript-code.md +++ b/dev/docs/javascript-code.md @@ -85,18 +85,18 @@ Will result with `this.$opts` being: A component has the below shown properties & methods available for use. As mentioned above, most of these should be used within the `setup()` function to make the requirements/dependencies of the component clear. ```javascript -// The root element that the compontent has been applied to. +// The root element that the component has been applied to. this.$el -// A map of defined element references within the compontent. +// A map of defined element references within the component. // See "Element References" above. this.$refs -// A map of defined multi-element references within the compontent. +// A map of defined multi-element references within the component. // See "Element References" above. this.$manyRefs -// Options defined for the compontent. +// Options defined for the component. this.$opts // The registered name of the component, usually kebab-case. @@ -115,6 +115,7 @@ There are various global helper libraries in BookStack which can be accessed via ```js // HTTP service +// Relative URLs will be resolved against the instance BASE_URL window.$http.get(url, params); window.$http.post(url, data); window.$http.put(url, data); @@ -153,4 +154,10 @@ window.$components.get(name); // Get the first active component of the given name that's been // created on the given element. window.$components.firstOnElement(element, name); -``` \ No newline at end of file +``` + +## Public Events + +There are a range of available events that are emitted as part of a public & supported API for accessing or extending JavaScript libraries & components used in the system. + +Details on these events can be found in the [JavaScript Public Events file](javascript-public-events.md).