basic recent changes implementation

This commit is contained in:
azivner
2017-09-26 23:23:03 -04:00
parent c6472a1c0c
commit b30bc19bd2
6 changed files with 88 additions and 7 deletions

View File

@@ -72,6 +72,10 @@ $("#insertLinkForm").submit(function() {
// when click on link popup, in case of internal link, just go the the referenced note instead of default behavior
// of opening the link in new window/tab
$(document).on('click', 'div.popover-content a', function(e) {
goToInternalNote(e);
});
function goToInternalNote(e, callback) {
const targetUrl = $(e.target).attr("href");
const noteIdMatch = /app#([A-Za-z0-9]{22})/.exec(targetUrl);
@@ -82,8 +86,12 @@ $(document).on('click', 'div.popover-content a', function(e) {
getNodeByKey(noteId).setActive();
e.preventDefault();
if (callback) {
callback();
}
}
});
}
function getNodeIdFromLabel(label) {
const noteIdMatch = / \(([A-Za-z0-9]{22})\)/.exec(label);