Skip to content

Commit

Permalink
Better document lib.hudson.widget-refresh (#10237)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisstern authored Feb 9, 2025
2 parents 72d2b7b + a68c9a1 commit f5bbd10
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/main/resources/lib/hudson/widget-refresh.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/**
* Use the `widget-refresh-reference` class on an element with `data-id` and `data-url` attributes.
* The content from the URL will be used to replace the element with the specified ID.
* Usually the URL content is an element with the same ID as specified here, to allow continuous updates.
* This is primarily used for sidepanel widgets, but not exclusively.
*/
Behaviour.specify(
".widget-refresh-reference",
"widget-refresh",
0,
function (e) {
var id = e.getAttribute("data-id");
var url = e.getAttribute("data-url");
let id = e.getAttribute("data-id");
let url = e.getAttribute("data-url");
refreshPart(id, url);
},
);

0 comments on commit f5bbd10

Please sign in to comment.