From 94b07d05c1cf5f09a83d95225bc1847b071bd8f5 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Wed, 26 May 2021 19:57:58 +0200 Subject: [PATCH] First half of #1996 (editing single books) --- cps/static/js/edit_books.js | 6 ++++++ cps/templates/book_edit.html | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index dbacdfdb..7c812ae9 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -263,3 +263,9 @@ $("#btn-upload-cover").on("change", function () { $("#upload-cover").html(filename); }); +$("#xchange").click(function () { + this.blur(); + var title = $("#book_title").val(); + $("#book_title").val($("#bookAuthor").val()); + $("#bookAuthor").val(title); +}); diff --git a/cps/templates/book_edit.html b/cps/templates/book_edit.html index 42e9801c..8ad88675 100644 --- a/cps/templates/book_edit.html +++ b/cps/templates/book_edit.html @@ -53,6 +53,10 @@ +
+ +
+