mirror of
https://github.com/gchq/CyberChef
synced 2025-01-08 10:38:46 +00:00
Move input tab code
This commit is contained in:
parent
713f10e63a
commit
749ffdd5d1
1 changed files with 16 additions and 17 deletions
|
@ -159,22 +159,6 @@ class TabWaiter {
|
|||
|
||||
newTab.appendChild(newTabContent);
|
||||
|
||||
if (io === "input") {
|
||||
const newTabButton = document.createElement("button");
|
||||
newTabButton.type = "button";
|
||||
newTabButton.className = "btn btn-primary bmd-btn-icon btn-close-tab";
|
||||
|
||||
const newTabButtonIcon = document.createElement("i");
|
||||
newTabButtonIcon.classList.add("material-icons");
|
||||
newTabButtonIcon.innerText = "clear";
|
||||
|
||||
newTabButton.appendChild(newTabButtonIcon);
|
||||
|
||||
newTabButton.addEventListener("click", this.manager.input.removeTabClick.bind(this.manager.input));
|
||||
|
||||
newTab.appendChild(newTabButton);
|
||||
}
|
||||
|
||||
return newTab;
|
||||
}
|
||||
|
||||
|
@ -186,7 +170,22 @@ class TabWaiter {
|
|||
* @returns {Element}
|
||||
*/
|
||||
createInputTabElement(inputNum, active=false) {
|
||||
return this.createTabElement(inputNum, active, "input");
|
||||
const newTab = this.createTabElement(inputNum, active, "input"),
|
||||
newTabButton = document.createElement("button"),
|
||||
newTabButtonIcon = document.createElement("i");
|
||||
newTabButton.type = "button";
|
||||
newTabButton.className = "btn btn-primary bmd-btn-icon btn-close-tab";
|
||||
|
||||
newTabButtonIcon.classList.add("material-icons");
|
||||
newTabButtonIcon.innerText = "clear";
|
||||
|
||||
newTabButton.appendChild(newTabButtonIcon);
|
||||
|
||||
newTabButton.addEventListener("click", this.manager.input.removeTabClick.bind(this.manager.input));
|
||||
|
||||
newTab.appendChild(newTabButton);
|
||||
|
||||
return newTab;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue