From e1477bd32e2e2abbc99fc22c4416486de98d2a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Desableau?= Date: Tue, 20 Aug 2019 01:58:49 +0200 Subject: [PATCH 1/2] Make context submenus don't overflow on Y axis --- customize.dist/src/less2/include/contextmenu.less | 4 ---- www/drive/inner.js | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/customize.dist/src/less2/include/contextmenu.less b/customize.dist/src/less2/include/contextmenu.less index e4d1318ec..023053438 100644 --- a/customize.dist/src/less2/include/contextmenu.less +++ b/customize.dist/src/less2/include/contextmenu.less @@ -29,10 +29,6 @@ .dropdown-menu { top: -0.7rem; left: 100%; - &.left { - left: 0%; - transform: translate(-100%); - } } } a { diff --git a/www/drive/inner.js b/www/drive/inner.js index ac63b1a33..be0a60f36 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -498,10 +498,16 @@ define([ var $el = $(el); var $a = $el.children().filter("a"); var $sub = $el.find(".dropdown-menu").first(); + var left, bottomOffset; var timeoutId; var showSubmenu = function () { clearTimeout(timeoutId); - $sub.toggleClass("left", $el.offset().left + $el.outerWidth() + $sub.outerWidth() > $(window).width()); + left = $el.offset().left + $el.outerWidth() + $sub.outerWidth() > $(window).width(); + bottomOffset = $el.offset().top + $el.outerHeight() + $sub.outerHeight() - $(window).height(); + $sub.css("left", left ? "0%": "100%"); + $sub.css("transform", "translate(" + + (left ? "-100%" : "0") + + "," + (bottomOffset > 0 ? -(bottomOffset - $el.outerHeight()) : 0) + "px)"); $el.siblings().find(".dropdown-menu").hide(); $sub.show(); }; From 24ea640397216dccd0ca4f4e471cbb760a2da8b9 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 20 Aug 2019 13:55:37 +0200 Subject: [PATCH 2/2] Kill the testworker to save memory usage --- www/common/cryptpad-common.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 3f0cf8af9..c18ba7411 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1368,10 +1368,12 @@ define([ errEv.preventDefault(); errEv.stopPropagation(); noWorker = true; + worker.terminate(); w(); }; worker.onmessage = function (ev) { if (ev.data === "OK") { + worker.terminate(); w(); } };