open/clse

master
funix 3 years ago
parent 49db009cec
commit 9ab91f3fcf

@ -37,7 +37,7 @@ $(document).ready(function(){
// generate divs // generate divs
Object.values(corpi).forEach(corpus => { Object.values(corpi).forEach(corpus => {
$('#boxes' ).append(`<div class="ui-widget-content draggable resizable closable" id="${corpus['id']}"><h1>${corpus['title']}</h1><p>${corpus['content']}</p><button>X</button></div>`) $('#boxes' ).append(`<div class="ui-widget-content draggable resizable" id="${corpus['id']}"><h1>${corpus['title']}</h1><p>${corpus['content']}</p><button class="closable">X</button></div>`)
$("#icons").append(`<button onclick="$(${corpus['id']}).fadeIn()" class="icon">${corpus["glyph"]}</button>`) $("#icons").append(`<button onclick="$(${corpus['id']}).fadeIn()" class="icon">${corpus["glyph"]}</button>`)
}); });
@ -110,16 +110,8 @@ $(document).ready(function(){
// close window // close window
$(".closable").click(function() { $(".closable").click(function() {
$( this ).fadeOut(); $( this ).parent().fadeOut();
}); });
// open window
// $( ".draggable" ).each(function() {
// let idid = $( this ).attr('id')
// // console.log(idid)
// $("#icons").append(`<button onclick="$(${idid}).fadeIn()" class="icon">${corpusglyph[idid]}</button>`)
// });
}); });

@ -37,7 +37,7 @@ button{
z-index: 2; z-index: 2;
cursor: grab; cursor: grab;
border: 2px white solid; border: 2px white solid;
background: black background: black;
} }
.draggable p{ .draggable p{
@ -73,15 +73,15 @@ button{
} }
.closable{ .closable{
position: absolute;
top: 0;
right: 0;
} }
.closable button{ .closable button{
width: 30px; width: 30px;
height: 30px; height: 30px;
position: absolute;
top: 0;
right: 0;
} }

Loading…
Cancel
Save