diff --git a/static/js/post-form.js b/static/js/post-form.js index 5ad099f..b3dbb57 100644 --- a/static/js/post-form.js +++ b/static/js/post-form.js @@ -24,6 +24,18 @@ $(function () { let form = $("#post-form"); let handle = $("#post-form-handle"); + let saved_top = window.localStorage.getItem("post_form_top"); + let saved_left = window.localStorage.getItem("post_form_left"); + + if (saved_top) { + form.css("top", saved_top); + } + + if (saved_left) { + form.css("left", saved_left); + form.css("right", "auto") + } + handle.on("mousedown", start); handle.get(0).addEventListener("touchstart", start, { passive: true }); $(document).on("mouseup", stop); @@ -107,6 +119,9 @@ $(function () { } form.css("right", "auto"); + + window.localStorage.setItem("post_form_top", form.css("top")); + window.localStorage.setItem("post_form_left", form.css("left")); } function stop() { diff --git a/templates/macros/post-form.html b/templates/macros/post-form.html index 85df7ca..520fdb8 100644 --- a/templates/macros/post-form.html +++ b/templates/macros/post-form.html @@ -12,7 +12,7 @@ {% else %} Nové vlákno {% endif %} - [Zavřít] + [X]