From 704f46837627df405d2ffcf0bd9b74faf8f72f86 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 10 Mar 2016 13:34:31 +0000 Subject: [PATCH] Replaced hidden div for textarea off-the screen Element with the content being copied cant be hidden so instead i\'ve moved it off the screen --- app/assets/stylesheets/pages/snippets.scss | 8 ++++++++ app/views/shared/snippets/_blob.html.haml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/snippets.scss b/app/assets/stylesheets/pages/snippets.scss index 7d414ae003d..639d639d5b0 100644 --- a/app/assets/stylesheets/pages/snippets.scss +++ b/app/assets/stylesheets/pages/snippets.scss @@ -28,3 +28,11 @@ border: 1px solid; line-height: 32px; } + +.markdown-snippet-copy { + position: fixed; + top: -10px; + left: -10px; + max-height: 0; + max-width: 0; +} diff --git a/app/views/shared/snippets/_blob.html.haml b/app/views/shared/snippets/_blob.html.haml index c84614c0879..773ce8ac240 100644 --- a/app/views/shared/snippets/_blob.html.haml +++ b/app/views/shared/snippets/_blob.html.haml @@ -1,6 +1,6 @@ - unless @snippet.content.empty? - if markup?(@snippet.file_name) - .hidden.blob-content{data: {blob_id: @snippet.id}} + %textarea.markdown-snippet-copy.blob-content{data: {blob_id: @snippet.id}} = @snippet.data .file-content.wiki = render_markup(@snippet.file_name, @snippet.data)