[view] fix change in FrameSwitcher

This commit is contained in:
2020-02-28 21:58:49 +03:00
parent 2428ed20e0
commit 7b7819fe6e

View File

@@ -57,11 +57,6 @@ class FrameSwitcher extends GroupView {
if (current == null) { if (current == null) {
throw 'frame "$id" not found'; throw 'frame "$id" not found';
} }
addView(current);
toUpdate();
update();
focus(current);
current.onShow(data);
if (animate != null) { if (animate != null) {
animate.cancel(); animate.cancel();
} }
@@ -71,6 +66,11 @@ class FrameSwitcher extends GroupView {
} else { } else {
removePrev(prev); removePrev(prev);
} }
addView(current);
toUpdate();
update();
focus(current);
current.onShow(data);
history.push({id:current.frameId, data:data}); history.push({id:current.frameId, data:data});
onSwitch.emit(current); onSwitch.emit(current);
return cast current; return cast current;