From 8af4a1d486d5dd31f1ecd73d2f214f923d5573e5 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 9 Jun 2021 14:40:24 +0200 Subject: [PATCH 1/2] Preserve scroll position in codemirror #731 --- www/common/sframe-common-codemirror.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 970272124..58475bbed 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -73,6 +73,8 @@ define([ else { editor.setSelection(posToCursor(selects[0], remoteDoc), posToCursor(selects[1], remoteDoc)); } + + editor.scrollTo(scroll.left, scroll.top); }; module.handleImagePaste = function (editor) { From e60206a5ba8a7980dc975c960c5ea4d4ac376a09 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 9 Jun 2021 14:54:55 +0200 Subject: [PATCH 2/2] Add 'Store in drive' entry in file menu when the pad is only stored in a team #744 --- www/common/common-ui-elements.js | 8 +++++++- www/common/outer/async-store.js | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 6216b2704..73019d6c4 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2884,7 +2884,13 @@ define([ UIElements.displayStorePadPopup = function (common, data) { if (storePopupState) { return; } storePopupState = true; - if (data && data.stored) { return; } // We won't display the popup for dropped files + // We won't display the popup for dropped files or already stored pads + if (data && data.stored) { + if (!data.inMyDrive) { + $('.cp-toolbar-storeindrive').show(); + } + return; + } var priv = common.getMetadataMgr().getPrivateData(); // This pad will be deleted automatically, it shouldn't be stored diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index d13cb09fb..66e1967cd 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1228,7 +1228,7 @@ define([ }); // Add the pad if it does not exist in our drive - if (!contains) { // || (ownedByMe && !inMyDrive)) { + if (!contains || (data.forceSave && !inMyDrive)) { var autoStore = Util.find(store.proxy, ['settings', 'general', 'autostore']); if (autoStore !== 1 && !data.forceSave && !data.path) { // send event to inner to display the corner popup @@ -1269,7 +1269,8 @@ define([ }); // Let inner know that dropped files shouldn't trigger the popup postMessage(clientId, "AUTOSTORE_DISPLAY_POPUP", { - stored: true + stored: true, + inMyDrive: inMyDrive }); nThen(function (waitFor) { sendTo.forEach(function (teamId) {