[PE] Fix Bug 33519.
When starting preview in the Chrome browser in fullscreen mode (F11) resize event isn't fired.
This commit is contained in:
parent
0fe19076ee
commit
4939665d9f
|
@ -122,10 +122,13 @@ define([
|
|||
|
||||
onPreview: function(btn, e) {
|
||||
var previewPanel = PE.getController('Viewport').getView('DocumentPreview'),
|
||||
me = this;
|
||||
me = this,
|
||||
isResized = false;
|
||||
if (previewPanel && me.api) {
|
||||
previewPanel.show();
|
||||
var onWindowResize = function() {
|
||||
if (isResized) return;
|
||||
isResized = true;
|
||||
Common.NotificationCenter.off('window:resize', onWindowResize);
|
||||
|
||||
var current = me.api.getCurrentPage();
|
||||
|
@ -136,6 +139,9 @@ define([
|
|||
if (!me.statusbar.mode.isDesktopApp && !Common.Utils.isIE11) {
|
||||
Common.NotificationCenter.on('window:resize', onWindowResize);
|
||||
me.fullScreen(document.documentElement);
|
||||
setTimeout(function(){
|
||||
onWindowResize();
|
||||
}, 100);
|
||||
} else
|
||||
onWindowResize();
|
||||
}
|
||||
|
|
|
@ -763,10 +763,13 @@ define([
|
|||
|
||||
onPreview: function(slidenum) {
|
||||
var previewPanel = PE.getController('Viewport').getView('DocumentPreview'),
|
||||
me = this;
|
||||
me = this,
|
||||
isResized = false;
|
||||
if (previewPanel && me.api) {
|
||||
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);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Preview');
|
||||
|
@ -774,6 +777,9 @@ define([
|
|||
if (!me.toolbar.mode.isDesktopApp && !Common.Utils.isIE11) {
|
||||
Common.NotificationCenter.on('window:resize', onWindowResize);
|
||||
me.fullScreen(document.documentElement);
|
||||
setTimeout(function(){
|
||||
onWindowResize();
|
||||
}, 100);
|
||||
} else
|
||||
onWindowResize();
|
||||
}
|
||||
|
|
|
@ -1291,6 +1291,7 @@ define([
|
|||
|
||||
var hkPreview = 'command+f5,ctrl+f5';
|
||||
keymap[hkPreview] = function(e) {
|
||||
var isResized = false;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (me.slidesCount>0) {
|
||||
|
@ -1298,12 +1299,17 @@ define([
|
|||
if (previewPanel && !previewPanel.isVisible() && me.api) {
|
||||
previewPanel.show();
|
||||
var onWindowResize = function() {
|
||||
if (isResized) return;
|
||||
isResized = true;
|
||||
Common.NotificationCenter.off('window:resize', onWindowResize);
|
||||
me.api.StartDemonstration('presentation-preview', 0);
|
||||
};
|
||||
if (!me.mode.isDesktopApp && !Common.Utils.isIE11) {
|
||||
Common.NotificationCenter.on('window:resize', onWindowResize);
|
||||
me.fullScreen(document.documentElement);
|
||||
setTimeout(function(){
|
||||
onWindowResize();
|
||||
}, 100);
|
||||
} else
|
||||
onWindowResize();
|
||||
}
|
||||
|
@ -1558,10 +1564,13 @@ define([
|
|||
var mnuPreview = new Common.UI.MenuItem({
|
||||
caption : me.txtPreview
|
||||
}).on('click', function(item) {
|
||||
var previewPanel = PE.getController('Viewport').getView('DocumentPreview');
|
||||
var previewPanel = PE.getController('Viewport').getView('DocumentPreview'),
|
||||
isResized = false;
|
||||
if (previewPanel && me.api) {
|
||||
previewPanel.show();
|
||||
var onWindowResize = function() {
|
||||
if (isResized) return;
|
||||
isResized = true;
|
||||
Common.NotificationCenter.off('window:resize', onWindowResize);
|
||||
|
||||
var current = me.api.getCurrentPage();
|
||||
|
@ -1572,6 +1581,9 @@ define([
|
|||
if (!me.mode.isDesktopApp && !Common.Utils.isIE11) {
|
||||
Common.NotificationCenter.on('window:resize', onWindowResize);
|
||||
me.fullScreen(document.documentElement);
|
||||
setTimeout(function(){
|
||||
onWindowResize();
|
||||
}, 100);
|
||||
} else
|
||||
onWindowResize();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue