Skip to content
Snippets Groups Projects
Commit 45e0f6f9 authored by brickode's avatar brickode
Browse files

Updated JSDoc, removed JQuery plugin

parent 26eb2ea8
No related branches found
No related tags found
1 merge request!7964JSDoc update and misc fixes
// /**
// * Refreshes a given element with the given text or node.
// *
// * @param {string|HTMLElement|DocumentFragment|function():HTMLElement} replacement The text or node to refresh with. Can be a function returning a node.
// *
// * @example
// * const div = document.createElement("div");
// * const text = `Any text, including template literals`;
// * div.append(App.UI.DOM.link("Link text", () => { // this link will be replaced with the given text
// * refresh(div, text);
// * }));
// *
// * function test() {
// * const div = document.createElement("div");
// * div.append(App.UI.DOM.link("Link text", () => {
// * refresh(div, test); // if function returns a DocumentFragment, use refresh(div, test());
// * }));
// * return div;
// * }
// *
// * @see For more examples, see killSlave.js and pit.js
// */
// $.fn.refresh = function(replacement) {
// if (typeof replacement === 'function') {
// return this.empty().append(replacement());
// } else {
// if (replacement !== '') {
// return this.empty().append(replacement);
// } else {
// return this;
// }
// }
// };
......@@ -193,7 +193,7 @@ App.UI.DOM.replace = function(selector, newContent) {
*
* function test() {
* const div = document.createElement("div");
* div.append(App.UI.DOM.link("Link text", () => {
* div.append(App.UI.DOM.link("Link text", () => { // this will cause div to be refreshed with any new options or changes
* App.UI.DOM.refresh(div, test); // if function returns a DocumentFragment, use refresh(div, test());
* }));
* return div;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment