Skip to content

Commit

Permalink
Avoid flickering on closing view tabs.
Browse files Browse the repository at this point in the history
Change-Id: I6d420ad6b802edee8fcf938a17be60079540867f
Reviewed-on: https://git.eclipse.org/r/80587
Tested-by: Hudson CI
Reviewed-by: Andreas Hoegger <Andreas.Hoegger@bsiag.com>
  • Loading branch information
ahoegger committed Sep 7, 2016
1 parent 1dca0a6 commit b68f76e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,19 @@ scout.SimpleTabBox.prototype.removeView = function(view, showSiblingView) {
}
showSiblingView = scout.nvl(showSiblingView, true);
var index = this.viewStack.indexOf(view);
var viewToActivate;
// if current view is the view to remove reset current view
if (this.currentView === view) {
this.currentView = null;
}

if (index > -1) {
// activate previous
if (showSiblingView) {
if (index - 1 >= 0) {
this.activateView(this.viewStack[index - 1]);
viewToActivate = this.viewStack[index - 1];
} else if (index + 1 < this.viewStack.length) {
this.activateView(this.viewStack[index + 1]);
viewToActivate = this.viewStack[index + 1];
}
}

Expand All @@ -230,6 +232,9 @@ scout.SimpleTabBox.prototype.removeView = function(view, showSiblingView) {
view: view
});

if(viewToActivate){
this.activateView(viewToActivate);
}
if (this.rendered) {
this.viewContent.invalidateLayoutTree();
this.viewContent.validateLayoutTree();
Expand Down

0 comments on commit b68f76e

Please sign in to comment.