mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
Disable desktop-app emoji handler. It breaks copying of formatted text
(imported from commit 14c9ee7ba61d4913da2d2e8c677739b573252525)
This commit is contained in:
@@ -164,28 +164,12 @@ function copy_handler(e) {
|
|||||||
skip_same_td_check = true;
|
skip_same_td_check = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the selection starts and ends in the same td,
|
// we should let the browser handle the copy-paste entirely on its own
|
||||||
// we want to let the browser handle the copy-paste mostly on its own
|
// (In this case, there is no need for our special copy code)
|
||||||
if (!skip_same_td_check &&
|
if (!skip_same_td_check &&
|
||||||
startc.parents('.selectable_row>div')[0] === endc.parents('.selectable_row>div')[0]) {
|
startc.parents('.selectable_row>div')[0] === endc.parents('.selectable_row>div')[0]) {
|
||||||
|
|
||||||
// If the user is not running the desktop app, let the browser handle
|
|
||||||
// the copy entirely on its own
|
|
||||||
if (window.bridge === undefined) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do nothing if the user is selecting anything while editing,
|
|
||||||
// as in that case we want to let the browser select the
|
|
||||||
// text field text as usual
|
|
||||||
if (startc.hasClass('edit-controls')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the user is running the desktop app, we still create "div"
|
|
||||||
// so that we can replace emoji with their text
|
|
||||||
div.append(range.cloneContents());
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// Construct a div for what we want to copy (div)
|
// Construct a div for what we want to copy (div)
|
||||||
|
|||||||
Reference in New Issue
Block a user