From 7e78981a8a58b365476726fc1f93cbf24d82cdf4 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Fri, 11 Aug 2017 09:48:40 +0300 Subject: [PATCH] remove timeout (reporter mode) --- .../main/app/controller/Viewport.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 08cf40de3..a435f2588 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -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); - setTimeout(function(){ + + if (!reporterObject) { + setTimeout(function(){ + _onWindowResize(); + }, 100); + } else { _onWindowResize(); - }, 100); + } } else _onWindowResize(); }