From 92632bc105c14952a6b9269c79195c2a08bf9e71 Mon Sep 17 00:00:00 2001 From: xiawenlong Date: Fri, 29 Oct 2021 14:04:15 +0800 Subject: [PATCH 1/2] fix fullscreen bug --- module/execution/js/kanban.js | 45 +++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 6576cfb8b3..ef0af5b2f4 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -292,17 +292,29 @@ function fullScreen() { var element = document.getElementById('kanbanContainer'); var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen; + var aArr = $('#kanbanContainer a.iframe'); if(requestMethod) { var afterEnterFullscreen = function() { $('#kanbanContainer').addClass('scrollbar-hover'); + $('.actions').hide(); + aArr.each(function() + { + if($(this).hasClass('iframe')) + { + var href = $(this).attr('href'); + $(this).removeClass('iframe'); + $(this).attr('href', 'javascript:void(0)'); + $(this).attr('href-bak', href); + } + }) $.cookie('isFullScreen', 1); } var whenFailEnterFullscreen = function() { - $.cookie('isFullScreen', 0); + exitFullScreen(); } try @@ -333,9 +345,38 @@ function fullScreen() function exitFullScreen() { $('#kanbanContainer').removeClass('scrollbar-hover'); - $('#content .actions').removeClass('hidden'); + $('.actions').show(); + $('#kanbanContainer a').each(function() + { + var hrefBak = $(this).attr('href-bak'); + console.log(hrefBak) + if(hrefBak) + { + $(this).addClass('iframe'); + $(this).attr('href', hrefBak); + } + }) $.cookie('isFullScreen', 0); } +document.addEventListener('fullscreenchange', function (e) +{ + if(!document.fullscreenElement) exitFullScreen(); +}); + +document.addEventListener('webkitfullscreenchange', function (e) +{ + if(!document.webkitFullscreenElement) exitFullScreen(); +}); + +document.addEventListener('mozfullscreenchange', function (e) +{ + if(!document.mozFullScreenElement) exitFullScreen(); +}); + +document.addEventListener('msfullscreenChange', function (e) +{ + if(!document.msfullscreenElement) exitFullScreen(); +}); /* Define drag and drop rules */ if(!window.kanbanDropRules) From 619b95257c2f0f92204b651805775a8027467b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=8E=89=E6=98=A5?= <563917701@qq.com> Date: Fri, 29 Oct 2021 06:15:03 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0module/execution/js/kanba?= =?UTF-8?q?n.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/execution/js/kanban.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index ef0af5b2f4..76556fe529 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -290,16 +290,15 @@ function createKanban(kanbanID, data, options) function fullScreen() { - var element = document.getElementById('kanbanContainer'); + var element = document.getElementById('kanbanContainer'); var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen; - var aArr = $('#kanbanContainer a.iframe'); if(requestMethod) { var afterEnterFullscreen = function() { $('#kanbanContainer').addClass('scrollbar-hover'); $('.actions').hide(); - aArr.each(function() + $('#kanbanContainer a.iframe').each(function() { if($(this).hasClass('iframe')) { @@ -349,7 +348,6 @@ function exitFullScreen() $('#kanbanContainer a').each(function() { var hrefBak = $(this).attr('href-bak'); - console.log(hrefBak) if(hrefBak) { $(this).addClass('iframe'); @@ -358,6 +356,7 @@ function exitFullScreen() }) $.cookie('isFullScreen', 0); } + document.addEventListener('fullscreenchange', function (e) { if(!document.fullscreenElement) exitFullScreen();