copy_and_paste: Change copy div css to match "day mode".

Color and background is made according to "day mode"
exclusively here because when copying the content
into, say, Gmail compose box, the styles come along.
This is done to avoid copying the content with dark
background when using the app in night mode.

We can avoid other custom styles since they are wrapped
inside another parent such as `.message_content`.
This commit is contained in:
Vaibhav
2019-03-21 20:20:57 +05:30
committed by Tim Abbott
parent 7f27c09704
commit 6191b4d93a

View File

@@ -192,7 +192,19 @@ function copy_handler() {
// Select div so that the browser will copy it
// instead of copying the original selection
div.css({position: 'absolute', left: '-99999px'})
div.css({
position: 'absolute',
left: '-99999px',
// Color and background is made according to "day mode"
// exclusively here because when copying the content
// into, say, Gmail compose box, the styles come along.
// This is done to avoid copying the content with dark
// background when using the app in night mode.
// We can avoid other custom styles since they are wrapped
// inside another parent such as `.message_content`.
color: '#333',
background: '#FFF',
})
.attr('id', 'copytempdiv');
$('body').append(div);
selection.selectAllChildren(div[0]);