Skip to content

Commit

Permalink
convert inputs to buttons for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 committed Aug 6, 2023
1 parent 4a30dfc commit a9d04a4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 272 deletions.

This file was deleted.

201 changes: 0 additions & 201 deletions core/src/main/resources/lib/form/hetero-list/hetero-list.js

This file was deleted.

19 changes: 18 additions & 1 deletion war/src/main/js/components/dropdowns/hetero-list.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import behaviorShim from "@/util/behavior-shim";
import Templates from "@/components/dropdowns/templates";
import Utils from "@/components/dropdowns/utils";
import * as Symbols from "@/util/symbols";
import { createElementFromHtml } from "@/util/dom";
import tippy from "tippy.js";

function init() {
Expand Down Expand Up @@ -31,8 +33,23 @@ function generateButtons() {

let btn = Array.from(e.querySelectorAll("BUTTON.hetero-list-add")).pop();
if (!btn) {
return;
let oldbtn = Array.from(e.querySelectorAll("INPUT.hetero-list-add")).pop();
if (!oldbtn) {
return;
}
btn = document.createElement("button");
btn.setAttribute("type", "button");
btn.classList.add("hetero-list-add", "jenkins-button");
btn.innerText = oldbtn.getAttribute("value")
if (oldbtn.hasAttribute("suffix")) {
btn.setAttribute("suffix", oldbtn.getAttribute("suffix"));
}
let chevron = createElementFromHtml(Symbols.CHEVRON_DOWN)
btn.appendChild(chevron);
oldbtn.parentNode.appendChild(btn);
oldbtn.remove();
}

let prototypes = e.lastElementChild;
while (!prototypes.classList.contains("prototypes")) {
prototypes = prototypes.previousElementSibling;
Expand Down
1 change: 1 addition & 0 deletions war/src/main/js/util/symbols.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a9d04a4

Please sign in to comment.