attempt to fix problem when inserting link

This commit is contained in:
azivner 2017-08-30 23:17:03 -04:00
parent c16ed9546b
commit 8a388842aa
2 changed files with 3 additions and 3 deletions

View file

@ -98,7 +98,7 @@
</div> </div>
<div id="insertLinkDialog" title="Recent notes" style="display: none;"> <div id="insertLinkDialog" title="Recent notes" style="display: none;">
<form> <form id="insertLinkForm">
<div class="form-group"> <div class="form-group">
<label for="noteAutocomplete">Link to note</label> <label for="noteAutocomplete">Link to note</label>
<input id="noteAutocomplete" style="width: 100%;"> <input id="noteAutocomplete" style="width: 100%;">
@ -109,7 +109,7 @@
<input id="linkTitle" style="width: 100%;"> <input id="linkTitle" style="width: 100%;">
</div> </div>
<button id="addLinkButton" class="btn btn-sm">Add link</button> <button id="addLinkButton" type="submit" class="btn btn-sm">Add link</button>
</form> </form>
</div> </div>

View file

@ -135,7 +135,7 @@ $(document).bind('keydown', 'alt+l', function() {
}); });
}); });
$("#addLinkButton").click(function() { $("#insertLinkForm").submit(function addLink() {
let val = $("#noteAutocomplete").val(); let val = $("#noteAutocomplete").val();
const noteIdMatch = / \(([A-Za-z0-9]{22})\)/.exec(val); const noteIdMatch = / \(([A-Za-z0-9]{22})\)/.exec(val);