fixed: hide note when network visible

fixed: network height
changed: escape to hide network
fixed: do not save if not needed
This commit is contained in:
quenousimporte 2023-02-05 10:20:27 +01:00
parent 276e4a0eff
commit 2136faf1ae
3 changed files with 15 additions and 3 deletions

View File

@ -17,7 +17,6 @@
<script src="main.js"></script>
<script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
<div id="networkpage" hidden>
<div id="network"></div>
</div>

15
main.js
View File

@ -648,6 +648,7 @@ function shownotelinks()
if (settings.enablenetwork)
{
networkpage.hidden = false;
md.hidden = true;
function id(note)
{
return localdata.indexOf(note);
@ -712,8 +713,9 @@ function shownotelinks()
var graph = new vis.Network(network, data, options);
graph.on("click", function(event)
{
loadnote(nodes.find(n => n.id == event.nodes[0]).label);
networkpage.hidden = true;
md.hidden = false;
loadnote(nodes.find(n => n.id == event.nodes[0]).label);
});
}
else
@ -1771,6 +1773,12 @@ function save()
return;
}
if (saved)
{
console.log("nothing to save");
return;
}
var content = getnotecontent();
if ((content == "" && backup != "") || content == "null" || content == "undefined")
{
@ -2031,6 +2039,11 @@ function mainkeydownhandler()
{
loadlast();
}
else if (networkpage.hidden == false)
{
networkpage.hidden = true;
md.hidden = false;
}
else if (preview.hidden == false)
{
togglepreview();

View File

@ -57,7 +57,7 @@ body::-webkit-scrollbar-thumb {
position: absolute;
top: 0;
width: 100%;
height: 600px;
height: 100%;
opacity: 1;
}