From 11b4e05631a49e115cf542f1e2edbbb0e2ff6942 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Fri, 8 Dec 2023 12:51:45 +0100 Subject: [PATCH] Fix mobile panels displaying when not selected Fix unable to select animations on mobile --- js/animations/timeline.js | 1 + js/modes.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/js/animations/timeline.js b/js/animations/timeline.js index 7300d305a..61d04e090 100644 --- a/js/animations/timeline.js +++ b/js/animations/timeline.js @@ -229,6 +229,7 @@ const Timeline = { }, revealTime(time) { let body = document.getElementById('timeline_body'); + if (!body) return; var scroll = body.scrollLeft; var playhead = time * Timeline.vue._data.size + 8; if (playhead < scroll || playhead > scroll + document.getElementById('timeline_vue').clientWidth - Timeline.vue._data.head_width) { diff --git a/js/modes.js b/js/modes.js index 4468094c2..cd0fb324f 100644 --- a/js/modes.js +++ b/js/modes.js @@ -62,15 +62,17 @@ class Mode extends KeybindItem { } UVEditor.beforeMoving(); - for (let id in Panels) { - let old_pos_data = Panels[id].position_data; - Panels[id].position_data = Interface.getModeData().panels[id]; - if (!Panels[id].position_data) { - Panels[id].position_data = Interface.getModeData().panels[id] = JSON.parse(JSON.stringify(old_pos_data)) + if (!Blockbench.isMobile) { + for (let id in Panels) { + let old_pos_data = Panels[id].position_data; + Panels[id].position_data = Interface.getModeData().panels[id]; + if (!Panels[id].position_data) { + Panels[id].position_data = Interface.getModeData().panels[id] = JSON.parse(JSON.stringify(old_pos_data)) + } + Panels[id].updateSlot(); } - Panels[id].updateSlot(); + updateSidebarOrder(); } - updateSidebarOrder(); Canvas.updateRenderSides() if (this.tool && BarItems[this.tool] && Condition(BarItems[this.tool])) {