From 04bd8e2c62a16ee1279303c3cb0a89badeec78de Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Jan 2019 11:20:53 +0300 Subject: [PATCH] Move onDocumentReady api event to the end of document loading (fix opening version history) --- apps/documenteditor/embed/js/ApplicationController.js | 4 +--- apps/documenteditor/main/app/controller/Main.js | 3 +-- apps/documenteditor/mobile/app/controller/Main.js | 3 +-- apps/presentationeditor/embed/js/ApplicationController.js | 3 +-- apps/presentationeditor/main/app/controller/Main.js | 3 +-- apps/presentationeditor/mobile/app/controller/Main.js | 3 +-- apps/spreadsheeteditor/embed/js/ApplicationController.js | 3 +-- apps/spreadsheeteditor/main/app/controller/Main.js | 4 ++-- apps/spreadsheeteditor/mobile/app/controller/Main.js | 3 +-- 9 files changed, 10 insertions(+), 19 deletions(-) diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 0ff8adb81..2d6faa102 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -216,8 +216,6 @@ var ApplicationController = new(function(){ } function onDocumentContentReady() { - Common.Gateway.documentReady(); - hidePreloader(); var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2); @@ -320,7 +318,7 @@ var ApplicationController = new(function(){ }, 2000); } }); - + Common.Gateway.documentReady(); Common.Analytics.trackEvent('Load', 'Complete'); } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 97bff0187..87ff306d9 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -802,8 +802,6 @@ define([ if (this._isDocReady) return; - Common.Gateway.documentReady(); - if (this._state.openDlg) this._state.openDlg.close(); @@ -994,6 +992,7 @@ define([ Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'}); $(document).on('contextmenu', _.bind(me.onContextMenu, me)); + Common.Gateway.documentReady(); }, onLicenseChanged: function(params) { diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index a0a9c853b..dda2f95af 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -485,8 +485,6 @@ define([ if (this._isDocReady) return; - Common.Gateway.documentReady(); - if (this._state.openDlg) uiApp.closeModal(this._state.openDlg); @@ -579,6 +577,7 @@ define([ me.applyLicense(); $(document).on('contextmenu', _.bind(me.onContextMenu, me)); + Common.Gateway.documentReady(); }, onLicenseChanged: function(params) { diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index 8c43b731f..480242965 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -213,8 +213,6 @@ var ApplicationController = new(function(){ } function onDocumentContentReady() { - Common.Gateway.documentReady(); - api.ShowThumbnails(false); api.asc_DeleteVerticalScroll(); @@ -394,6 +392,7 @@ var ApplicationController = new(function(){ }); $('#btn-play').on('click', onPlayStart); + Common.Gateway.documentReady(); Common.Analytics.trackEvent('Load', 'Complete'); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index e16ee8f01..729f69176 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -591,8 +591,6 @@ define([ if (this._isDocReady) return; - Common.Gateway.documentReady(); - if (this._state.openDlg) this._state.openDlg.close(); @@ -758,6 +756,7 @@ define([ Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'}); $(document).on('contextmenu', _.bind(me.onContextMenu, me)); + Common.Gateway.documentReady(); }, onLicenseChanged: function(params) { diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 5711d4b2d..79e6be001 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -464,8 +464,6 @@ define([ if (this._isDocReady) return; - Common.Gateway.documentReady(); - if (this._state.openDlg) uiApp.closeModal(this._state.openDlg); @@ -533,6 +531,7 @@ define([ me.applyLicense(); $(document).on('contextmenu', _.bind(me.onContextMenu, me)); + Common.Gateway.documentReady(); }, onLicenseChanged: function(params) { diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index 7f02ad1c9..3173c78fb 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -168,8 +168,6 @@ var ApplicationController = new(function(){ } function onDocumentContentReady() { - Common.Gateway.documentReady(); - hidePreloader(); if ( !embedConfig.shareUrl ) @@ -292,6 +290,7 @@ var ApplicationController = new(function(){ } }); + Common.Gateway.documentReady(); Common.Analytics.trackEvent('Load', 'Complete'); } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index df955255c..8c1099d54 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -601,8 +601,6 @@ define([ if (this._isDocReady) return; - Common.Gateway.documentReady(); - if (this._state.openDlg) this._state.openDlg.close(); @@ -785,6 +783,8 @@ define([ if (typeof document.hidden !== 'undefined' && document.hidden) { document.addEventListener('visibilitychange', checkWarns); } else checkWarns(); + + Common.Gateway.documentReady(); }, onLicenseChanged: function(params) { diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 63d867455..1df299bc1 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -466,8 +466,6 @@ define([ if (this._isDocReady) return; - Common.Gateway.documentReady(); - if (this._state.openDlg) uiApp.closeModal(this._state.openDlg); @@ -550,6 +548,7 @@ define([ }); $(document).on('contextmenu', _.bind(me.onContextMenu, me)); + Common.Gateway.documentReady(); }, onLicenseChanged: function(params) {