Fix clipboard "fixes"
This commit is contained in:
parent
1831e2e63e
commit
dbe6df1ab6
@ -4,6 +4,7 @@
|
||||
role="log"
|
||||
aria-live="polite"
|
||||
aria-relevant="additions"
|
||||
@copy="onCopy"
|
||||
>
|
||||
<template v-for="(message, id) in getCondensedMessages">
|
||||
<div
|
||||
@ -41,6 +42,7 @@
|
||||
|
||||
<script>
|
||||
const constants = require("../js/constants");
|
||||
const clipboard = require("../js/clipboard");
|
||||
import Message from "./Message.vue";
|
||||
import MessageCondensed from "./MessageCondensed.vue";
|
||||
|
||||
@ -110,6 +112,9 @@ export default {
|
||||
|
||||
return true;
|
||||
},
|
||||
onCopy() {
|
||||
clipboard(this.$el);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,9 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
const $ = require("jquery");
|
||||
const chat = document.getElementById("chat");
|
||||
|
||||
function copyMessages() {
|
||||
module.exports = function(chat) {
|
||||
const selection = window.getSelection();
|
||||
|
||||
// If selection does not span multiple elements, do nothing
|
||||
@ -37,6 +36,4 @@ function copyMessages() {
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
$(chat).on("copy", ".messages", copyMessages);
|
||||
};
|
||||
|
@ -18,7 +18,6 @@ window.vueMounted = () => {
|
||||
const utils = require("./utils");
|
||||
require("./webpush");
|
||||
require("./keybinds");
|
||||
require("./clipboard");
|
||||
|
||||
const sidebar = $("#sidebar, #footer");
|
||||
const viewport = $("#viewport");
|
||||
|
Loading…
Reference in New Issue
Block a user