Move onDocumentReady api event to the end of document loading (fix opening version history)

This commit is contained in:
Julia Radzhabova 2019-01-10 11:20:53 +03:00
parent 620df09aff
commit 04bd8e2c62
9 changed files with 10 additions and 19 deletions

View file

@ -216,8 +216,6 @@ var ApplicationController = new(function(){
} }
function onDocumentContentReady() { function onDocumentContentReady() {
Common.Gateway.documentReady();
hidePreloader(); hidePreloader();
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2); var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2);
@ -320,7 +318,7 @@ var ApplicationController = new(function(){
}, 2000); }, 2000);
} }
}); });
Common.Gateway.documentReady();
Common.Analytics.trackEvent('Load', 'Complete'); Common.Analytics.trackEvent('Load', 'Complete');
} }

View file

@ -802,8 +802,6 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
Common.Gateway.documentReady();
if (this._state.openDlg) if (this._state.openDlg)
this._state.openDlg.close(); this._state.openDlg.close();
@ -994,6 +992,7 @@ define([
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'}); Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
$(document).on('contextmenu', _.bind(me.onContextMenu, me)); $(document).on('contextmenu', _.bind(me.onContextMenu, me));
Common.Gateway.documentReady();
}, },
onLicenseChanged: function(params) { onLicenseChanged: function(params) {

View file

@ -485,8 +485,6 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
Common.Gateway.documentReady();
if (this._state.openDlg) if (this._state.openDlg)
uiApp.closeModal(this._state.openDlg); uiApp.closeModal(this._state.openDlg);
@ -579,6 +577,7 @@ define([
me.applyLicense(); me.applyLicense();
$(document).on('contextmenu', _.bind(me.onContextMenu, me)); $(document).on('contextmenu', _.bind(me.onContextMenu, me));
Common.Gateway.documentReady();
}, },
onLicenseChanged: function(params) { onLicenseChanged: function(params) {

View file

@ -213,8 +213,6 @@ var ApplicationController = new(function(){
} }
function onDocumentContentReady() { function onDocumentContentReady() {
Common.Gateway.documentReady();
api.ShowThumbnails(false); api.ShowThumbnails(false);
api.asc_DeleteVerticalScroll(); api.asc_DeleteVerticalScroll();
@ -394,6 +392,7 @@ var ApplicationController = new(function(){
}); });
$('#btn-play').on('click', onPlayStart); $('#btn-play').on('click', onPlayStart);
Common.Gateway.documentReady();
Common.Analytics.trackEvent('Load', 'Complete'); Common.Analytics.trackEvent('Load', 'Complete');
} }

View file

@ -591,8 +591,6 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
Common.Gateway.documentReady();
if (this._state.openDlg) if (this._state.openDlg)
this._state.openDlg.close(); this._state.openDlg.close();
@ -758,6 +756,7 @@ define([
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'}); Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
$(document).on('contextmenu', _.bind(me.onContextMenu, me)); $(document).on('contextmenu', _.bind(me.onContextMenu, me));
Common.Gateway.documentReady();
}, },
onLicenseChanged: function(params) { onLicenseChanged: function(params) {

View file

@ -464,8 +464,6 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
Common.Gateway.documentReady();
if (this._state.openDlg) if (this._state.openDlg)
uiApp.closeModal(this._state.openDlg); uiApp.closeModal(this._state.openDlg);
@ -533,6 +531,7 @@ define([
me.applyLicense(); me.applyLicense();
$(document).on('contextmenu', _.bind(me.onContextMenu, me)); $(document).on('contextmenu', _.bind(me.onContextMenu, me));
Common.Gateway.documentReady();
}, },
onLicenseChanged: function(params) { onLicenseChanged: function(params) {

View file

@ -168,8 +168,6 @@ var ApplicationController = new(function(){
} }
function onDocumentContentReady() { function onDocumentContentReady() {
Common.Gateway.documentReady();
hidePreloader(); hidePreloader();
if ( !embedConfig.shareUrl ) if ( !embedConfig.shareUrl )
@ -292,6 +290,7 @@ var ApplicationController = new(function(){
} }
}); });
Common.Gateway.documentReady();
Common.Analytics.trackEvent('Load', 'Complete'); Common.Analytics.trackEvent('Load', 'Complete');
} }

View file

@ -601,8 +601,6 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
Common.Gateway.documentReady();
if (this._state.openDlg) if (this._state.openDlg)
this._state.openDlg.close(); this._state.openDlg.close();
@ -785,6 +783,8 @@ define([
if (typeof document.hidden !== 'undefined' && document.hidden) { if (typeof document.hidden !== 'undefined' && document.hidden) {
document.addEventListener('visibilitychange', checkWarns); document.addEventListener('visibilitychange', checkWarns);
} else checkWarns(); } else checkWarns();
Common.Gateway.documentReady();
}, },
onLicenseChanged: function(params) { onLicenseChanged: function(params) {

View file

@ -466,8 +466,6 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
Common.Gateway.documentReady();
if (this._state.openDlg) if (this._state.openDlg)
uiApp.closeModal(this._state.openDlg); uiApp.closeModal(this._state.openDlg);
@ -550,6 +548,7 @@ define([
}); });
$(document).on('contextmenu', _.bind(me.onContextMenu, me)); $(document).on('contextmenu', _.bind(me.onContextMenu, me));
Common.Gateway.documentReady();
}, },
onLicenseChanged: function(params) { onLicenseChanged: function(params) {