From 12f3e8d6bbd7bd9d79802493391b033e6fe0a67e Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Tue, 30 Mar 2021 16:40:26 +0100 Subject: [PATCH] Merge pull request #3847 from overleaf/ae-user-select-out-of-sync Display the Out Of Sync modal file contents in a readonly textarea GitOrigin-RevId: b91ff3ad32c3ed07987858e83571887ae356f4f3 --- services/web/app/views/project/editor.pug | 2 +- services/web/frontend/js/ide/services/ide.js | 1 + services/web/frontend/stylesheets/app/editor.less | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/project/editor.pug b/services/web/app/views/project/editor.pug index 1e77cf22b3..bce1a8c785 100644 --- a/services/web/app/views/project/editor.pug +++ b/services/web/app/views/project/editor.pug @@ -151,7 +151,7 @@ block content ) | {{showFileContents ? "Hide" : "Show"}} Local File Contents .text-preview(ng-show="showFileContents") - .scroll-container + textarea.scroll-container(readonly="readonly" rows="{{editorContentRows}}") | {{editorContent}} .modal-footer diff --git a/services/web/frontend/js/ide/services/ide.js b/services/web/frontend/js/ide/services/ide.js index 9a5f08698b..ca77175dea 100644 --- a/services/web/frontend/js/ide/services/ide.js +++ b/services/web/frontend/js/ide/services/ide.js @@ -162,6 +162,7 @@ App.controller('OutOfSyncModalController', function( $scope.title = title $scope.message = message $scope.editorContent = editorContent + $scope.editorContentRows = editorContent.split('\n').length $scope.done = () => { // Reload the page to avoid staying in an inconsistent state. diff --git a/services/web/frontend/stylesheets/app/editor.less b/services/web/frontend/stylesheets/app/editor.less index d5d855e4e6..bd01e4a71e 100644 --- a/services/web/frontend/stylesheets/app/editor.less +++ b/services/web/frontend/stylesheets/app/editor.less @@ -494,6 +494,7 @@ CodeMirror margin-top: @line-height-computed / 2; .scroll-container { max-height: 360px; + width: 100%; background-color: white; font-size: 0.8em; line-height: 1.1em;