I'd add the following condition after  _currentViewProvider _$currentCustomViewer.is(":visible")