Skip to content

Commit

Permalink
Merge pull request ilian6806#18 from ilian6806/develop
Browse files Browse the repository at this point in the history
Reset button changes to fit new SD
  • Loading branch information
ilian6806 committed Apr 4, 2023
2 parents 0fd00f9 + 463706b commit 36697c8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions javascript/state.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,18 @@ state.core = (function () {
}

function loadUI() {

let toolbar = document.createElement("div");
toolbar.style.minWidth = 0;
toolbar.className = "gr-box relative w-full border-solid border border-gray-200 gr-padded";

let resetBtn = document.createElement("button");
resetBtn.innerHTML = "🔁";
resetBtn.className = "gr-button gr-button-lg gr-button-tool";
resetBtn.style.border = "none";
resetBtn.title = "Reset State";
resetBtn.innerHTML = "*️⃣";
resetBtn.addEventListener('click', function () {
let confirmed = confirm('Reset all state values?');
if (confirmed) {
store.clearAll();
alert('All state values deleted!');
}
});

toolbar.appendChild(resetBtn);

let quickSettings = gradioApp().getElementById("quicksettings");
quickSettings.appendChild(toolbar);
resetBtn.className = quickSettings.querySelector('button').className;
quickSettings.appendChild(resetBtn);
}


Expand Down

0 comments on commit 36697c8

Please sign in to comment.