Bug 1472364 - immediately propagate resizes triggered through changing toolbox hosts, r=bgrins

to avoid flicker/delays, immediately enforce we update the size of the inspector once the devtools move from one place to another.

Differential Revision: https://phabricator.services.mozilla.com/D1941

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2018-07-09 16:37:58 +00:00
Родитель 41a5d0da21
Коммит 4222af1c46
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -1269,7 +1269,12 @@ Inspector.prototype = {
* Handler for the "host-changed" event from the toolbox. Resets the inspector
* sidebar sizes when the toolbox host type changes.
*/
onHostChanged: function() {
async onHostChanged() {
// Eagerly call our resize handling code to process the fact that we
// switched hosts. If we don't do this, we'll wait for resize events + 200ms
// to have passed, which causes the old layout to noticeably show up in the
// new host, followed by the updated one.
await this._onLazyPanelResize();
if (!this.is3PaneModeEnabled) {
return;
}