From bf152232b6ed28fc2c9c34e5f226db0bd140db26 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 26 Oct 2017 16:26:15 +0300 Subject: [PATCH] [PE] Fix Bug 36166. --- .../main/app/view/DocumentPreview.js | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/apps/presentationeditor/main/app/view/DocumentPreview.js b/apps/presentationeditor/main/app/view/DocumentPreview.js index c948a37bd..0c664a3bf 100644 --- a/apps/presentationeditor/main/app/view/DocumentPreview.js +++ b/apps/presentationeditor/main/app/view/DocumentPreview.js @@ -227,10 +227,18 @@ define([ } } ); + + this.previewControls = $(this.el).find('.preview-controls'); + $(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){ var fselem = (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement ); me.btnFullScreen.cmpEl.toggleClass('fullscreen', fselem !== undefined && fselem !== null); + setTimeout( function() { + me.previewControls.css('display', ''); + me.$el.css('cursor', ''); + },100); + if (Common.Utils.isIE) { // for tooltips in IE me.btnFullScreen.updateHint( fselem ? '' : me.txtFullScreen); me.btnPrev.updateHint( fselem ? '' : me.txtPrev); @@ -242,18 +250,17 @@ define([ }); if (Common.Utils.isIE) { - el.find('.preview-controls').css('opacity', '0.4'); + me.previewControls.css('opacity', '0.4'); } this.separatorFullScreen = el.find('.separator.fullscreen'); - var controls = $(this.el).find('.preview-controls'); - controls.on('mouseenter', function(e) { + me.previewControls.on('mouseenter', function(e) { clearTimeout(me.timerMove); - controls.addClass('over'); + me.previewControls.addClass('over'); }); - controls.on('mouseleave', function(e) { - controls.removeClass('over'); + me.previewControls.on('mouseleave', function(e) { + me.previewControls.removeClass('over'); }); }, @@ -274,18 +281,17 @@ define([ } var me = this; - var controls = $(this.el).find('.preview-controls'); - controls.css('display', 'none'); + me.previewControls.css('display', 'none'); me.$el.css('cursor', 'none'); setTimeout(function(){ me.$el.on('mousemove', function() { clearTimeout(me.timerMove); - controls.css('display', ''); + me.previewControls.css('display', ''); me.$el.css('cursor', ''); - if (!controls.hasClass('over')) + if (!me.previewControls.hasClass('over')) me.timerMove = setTimeout(function () { - controls.css('display', 'none'); + me.previewControls.css('display', 'none'); me.$el.css('cursor', 'none'); }, 3000); @@ -374,6 +380,8 @@ define([ fullScreen: function(element) { if (this.mode.isDesktopApp || Common.Utils.isIE11) return; if (element) { + this.previewControls.css('display', 'none'); + this.$el.css('cursor', 'none'); if(element.requestFullscreen) { element.requestFullscreen(); } else if(element.webkitRequestFullscreen) { @@ -388,6 +396,8 @@ define([ fullScreenCancel: function () { if (this.mode.isDesktopApp || Common.Utils.isIE11) return; + this.previewControls.css('display', 'none'); + this.$el.css('cursor', 'none'); if(document.cancelFullScreen) { document.cancelFullScreen(); } else if(document.webkitCancelFullScreen ) {