Skip to content

Commit

Permalink
Added the 'Edit' button on the filenode iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
odomanov committed Sep 24, 2020
1 parent 23bf730 commit 2ee4034
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
z-index: 101;
}

#edit-button {
display: block;
position: absolute;
left: 5em;
z-index: 101;
}

#view-menu {
position: absolute;
right: 0;
Expand Down Expand Up @@ -231,6 +238,7 @@
<div id="temp-network"></div>
<div class="fileframe" id="fileframe">
<button class="btn btn-link float-left" id="iframe-button">Back</button>
<button class="btn btn-link" id="edit-button">Edit</button>
<iframe src="" id="filenode"></iframe>
<iframe src="" id="backlinks"></iframe>
</div>
Expand Down Expand Up @@ -327,6 +335,12 @@
window.history.back()
});

$("#fileframe #edit-button")
.on("click", function iframeGoEdit() {
url = "org-protocol://roam-file?file=".concat(filenodePath);
window.open(url, "_self");
});

function onWindowResize () {
$("#filenode").width(($(window).width() - 50) * 0.7);
$("#backlinks").width(($(window).width() - 50) * 0.3);
Expand Down Expand Up @@ -647,6 +661,7 @@
for (var i = 0; i < select2Data.length; i++) {
if (select2Data[i].id === string) {
var link = `org-roam-buffer?path=${select2Data[i].path}&label=${select2Data[i].text}&token=${token}`;
filenodePath = select2Data[i].path;
break
}
}
Expand Down

0 comments on commit 2ee4034

Please sign in to comment.