mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user