diff options
| author | Neo <50623835+neobooru@users.noreply.github.com> | 2024-04-26 22:56:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-26 22:56:58 +0200 |
| commit | 6edb25d87b24db087fdf6496552a31979a7c2ec8 (patch) | |
| tree | 1923a5caf037f61090d8455292675e3555e7cdc3 /client/js/controls | |
| parent | 93fc15f2a4a4a50424e38831bed086c3ee6fd9d1 (diff) | |
| parent | c1c695f082f53819f092a535aa08125e3f3f48bb (diff) | |
Merge pull request #641 from po5/mobile
Mobile improvements
Diffstat (limited to 'client/js/controls')
| -rw-r--r-- | client/js/controls/post_content_control.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/js/controls/post_content_control.js b/client/js/controls/post_content_control.js index 55daca7..8cbd5d8 100644 --- a/client/js/controls/post_content_control.js +++ b/client/js/controls/post_content_control.js @@ -103,6 +103,30 @@ class PostContentControl { } _refreshSize() { + if (window.innerWidth <= 800) { + const buttons = document.querySelector(".sidebar > .buttons"); + if (buttons) { + const content = document.querySelector(".content"); + content.insertBefore(buttons, content.querySelector(".post-container + *")); + + const afterControls = document.querySelector(".content > .after-mobile-controls"); + if (afterControls) { + afterControls.parentElement.parentElement.appendChild(afterControls); + } + } + } else { + const buttons = document.querySelector(".content > .buttons"); + if (buttons) { + const sidebar = document.querySelector(".sidebar"); + sidebar.insertBefore(buttons, sidebar.firstElementChild); + } + + const afterControls = document.querySelector(".content + .after-mobile-controls"); + if (afterControls) { + document.querySelector(".content").appendChild(afterControls); + } + } + this._currentFitFunction(); } |