diff --git a/static/js/base.js b/static/js/base.js index b03c1359..8bd6b8ca 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -130,7 +130,6 @@ function displayNote(note, alias, user_note_field = null, profile_pic_field = nu if (profile_pic_field != null) { $("#" + profile_pic_field).attr('src', img); $("#" + profile_pic_field).click(function () { - console.log(note); if (note.resourcetype === "NoteUser") { document.location.href = "/accounts/user/" + note.user; } else if (note.resourcetype === "NoteClub") { @@ -223,9 +222,7 @@ function autoCompleteNote(field_id, note_list_id, notes, notes_display, alias_pr // When the user type "Enter", the first alias is clicked field.keypress(function (event) { - console.log(notes); if (event.originalEvent.charCode === 13 && notes.length > 0) { - console.log(42); let li_obj = field.parent().find("ul li").first(); displayNote(notes[0], li_obj.text(), user_note_field, profile_pic_field); li_obj.trigger("click"); diff --git a/static/js/transfer.js b/static/js/transfer.js index 97dad879..ed651640 100644 --- a/static/js/transfer.js +++ b/static/js/transfer.js @@ -7,7 +7,7 @@ function refreshHistory() { $("#history").load("/note/transfer/ #history"); } -function reset() { +function reset(refresh=true) { sources_notes_display.length = 0; sources.length = 0; dests_notes_display.length = 0; @@ -21,8 +21,10 @@ function reset() { $("#bank").val(""); $("#user_note").val(""); $("#profile_pic").attr("src", "/media/pic/default.png"); - refreshBalance(); - refreshHistory(); + if (refresh) { + refreshBalance(); + refreshHistory(); + } } $(document).ready(function() { @@ -138,15 +140,18 @@ $(document).ready(function() { $("#source_me").click(function() { // Shortcut to set the current user as the only emitter - reset(); + reset(false); let source_note = $("#source_note"); source_note.focus(); - source_note.val(username); + source_note.val(""); let event = jQuery.Event("keyup"); - event.originalEvent = {charCode: 0}; + event.originalEvent = {charCode: 97}; + source_note.trigger(event); + source_note.val(username); + event = jQuery.Event("keyup"); + event.originalEvent = {charCode: 97}; source_note.trigger(event); - console.log(sources.length); let fill_note = function() { if (sources.length === 0) { setTimeout(fill_note, 100); diff --git a/templates/note/transaction_form.html b/templates/note/transaction_form.html index 7757bad1..fd3e5406 100644 --- a/templates/note/transaction_form.html +++ b/templates/note/transaction_form.html @@ -56,9 +56,9 @@ SPDX-License-Identifier: GPL-2.0-or-later