remove timeout (reporter mode)

This commit is contained in:
Oleg Korshul 2017-08-11 09:48:40 +03:00
parent 09a49ed246
commit 7e78981a8a

View file

@ -158,21 +158,29 @@ define([
this.previewPanel = this.previewPanel || PE.getController('Viewport').getView('DocumentPreview');
var me = this,
isResized = false;
var reporterObject = PE.getController('Main').document;
if (this.previewPanel && !this.previewPanel.isVisible() && this.api) {
this.previewPanel.show();
var _onWindowResize = function() {
if (isResized) return;
isResized = true;
Common.NotificationCenter.off('window:resize', _onWindowResize);
me.api.StartDemonstration('presentation-preview', _.isNumber(slidenum) ? slidenum : 0, PE.getController('Main').document);
me.api.StartDemonstration('presentation-preview', _.isNumber(slidenum) ? slidenum : 0, reporterObject);
Common.component.Analytics.trackEvent('Viewport', 'Preview');
};
if (!me.viewport.mode.isDesktopApp && !Common.Utils.isIE11) {
Common.NotificationCenter.on('window:resize', _onWindowResize);
me.fullScreen(document.documentElement);
if (!reporterObject) {
setTimeout(function(){
_onWindowResize();
}, 100);
} else {
_onWindowResize();
}
} else
_onWindowResize();
}