mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Fix Reset Layout not working with panel changes
This commit is contained in:
parent
1fd58f2d17
commit
8a43a16f6b
@ -350,6 +350,11 @@ class Panel extends EventSystem {
|
||||
if (!this.position_data.height) this.position_data.height = defaultp.height || 300;
|
||||
if (this.position_data.folded == undefined) this.position_data.folded = defaultp.folded || false;
|
||||
|
||||
for (let mode_id in Interface.data.modes) {
|
||||
let mode_data = Interface.getModeData(mode_id);
|
||||
if (!mode_data.panels[this.id]) mode_data.panels[this.id] = JSON.parse(JSON.stringify(this.position_data));
|
||||
}
|
||||
|
||||
this.moveTo(this.slot);
|
||||
this.fold(this.folded);
|
||||
return this;
|
||||
@ -538,8 +543,7 @@ class Panel extends EventSystem {
|
||||
return this;
|
||||
}
|
||||
updateSlot() {
|
||||
let position_data = this.position_data;
|
||||
let {slot} = position_data;
|
||||
let slot = this.slot;
|
||||
|
||||
this.node.classList.remove('floating');
|
||||
|
||||
|
@ -63,7 +63,11 @@ 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))
|
||||
}
|
||||
Panels[id].updateSlot();
|
||||
}
|
||||
updateSidebarOrder();
|
||||
|
Loading…
Reference in New Issue
Block a user