Pozice formuláře v localStorage
Tento commit je obsažen v:
rodič
fcdd039993
revize
28cefbd590
@ -24,6 +24,18 @@ $(function () {
|
|||||||
let form = $("#post-form");
|
let form = $("#post-form");
|
||||||
let handle = $("#post-form-handle");
|
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.on("mousedown", start);
|
||||||
handle.get(0).addEventListener("touchstart", start, { passive: true });
|
handle.get(0).addEventListener("touchstart", start, { passive: true });
|
||||||
$(document).on("mouseup", stop);
|
$(document).on("mouseup", stop);
|
||||||
@ -107,6 +119,9 @@ $(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
form.css("right", "auto");
|
form.css("right", "auto");
|
||||||
|
|
||||||
|
window.localStorage.setItem("post_form_top", form.css("top"));
|
||||||
|
window.localStorage.setItem("post_form_left", form.css("left"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop() {
|
function stop() {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
Nové vlákno
|
Nové vlákno
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a class="close-post-form float-r" href="#">[Zavřít]</a>
|
<a class="close-post-form float-r" href="#">[X]</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele