click an image from the history tab to reuse its seed

history-tab
Abdullah Alfaraj 2022-12-31 19:31:24 +03:00
parent c2d0505670
commit 8632d0f4e5
2 changed files with 18 additions and 2 deletions

View File

@ -151,7 +151,15 @@
display: flex; display: flex;
margin-left: auto; margin-left: auto;
} }
.flexContainer{
flex: 0 0 auto;
display: flex;
flex-direction: row;
}
#historySeedLabelContainer {
display: flex;
margin-left: auto;
}
#menu-bar-container { #menu-bar-container {
width: 100%; width: 100%;
@ -249,7 +257,13 @@
<sp-label slot="label" id="lVersionNumber">v0.0.0</sp-label> <sp-label slot="label" id="lVersionNumber">v0.0.0</sp-label>
</div> </div>
<div class="sp-tab-page" id="sp-history-tab-page"> <div class="sp-tab-page" id="sp-history-tab-page">
<sp-label slot="label">history of all the images you generated</sp-label> <div class="flexContainer">
<sp-label slot="label">history of all the images you generated</sp-label>
<div id="historySeedLabelContainer">
<sp-label slot="label">Seed:</sp-label><sp-label slot="label" id="historySeedLabel">00000000000</sp-label>
</div>
</div>
<div> <div>
</div> </div>

View File

@ -1270,6 +1270,8 @@ document.getElementById('btnLoadHistory').addEventListener('click',async functio
img.addEventListener('click',(e)=>{ img.addEventListener('click',(e)=>{
const metadata_json = JSON.parse(e.target.dataset.metadata_json_string) const metadata_json = JSON.parse(e.target.dataset.metadata_json_string)
console.log("metadata_json: ",metadata_json) console.log("metadata_json: ",metadata_json)
document.querySelector('#tiSeed').value = metadata_json.Seed
document.querySelector('#historySeedLabel').textContent = metadata_json.Seed
}) })
i++ i++
} }