Browse Source

Remove uses of window.event.

window.event is a deprecated global that's set to the currently
dispatched event.

- Opened and closed mentions box by clicking its icon in the top bar
- Left and right clicked on an inline channel name and saw context menu
  open both times
- Two-finger swiped on iOS and saw channel change
- Long-touched and dragged channel in network list on iOS and reordered
  the list successfully
pull/4434/head
itsjohncs 1 month ago
parent
commit
763047889d
  1. 4
      .eslintrc.yml
  2. 2
      client/components/Chat.vue
  3. 2
      client/components/InlineChannel.vue
  4. 2
      client/components/NetworkList.vue
  5. 2
      client/js/helpers/listenForTwoFingerSwipes.js

4
.eslintrc.yml

@ -23,6 +23,10 @@ rules:
no-duplicate-imports: error
no-else-return: error
no-implicit-globals: error
no-restricted-globals:
- error
- event
- fdescribe
no-shadow: error
no-template-curly-in-string: error
no-unsafe-negation: error

2
client/components/Chat.vue

@ -227,7 +227,7 @@ export default {
network: this.network,
});
},
openMentions() {
openMentions(event) {
eventbus.emit("mentions:toggle", {
event: event,
});

2
client/components/InlineChannel.vue

@ -19,7 +19,7 @@ export default {
channel: String,
},
methods: {
openContextMenu() {
openContextMenu(event) {
eventbus.emit("contextmenu:inline-channel", {
event: event,
channel: this.channel,

2
client/components/NetworkList.vue

@ -348,7 +348,7 @@ export default {
event.item.classList.remove("ui-sortable-dragging-touch-cue");
this.startDrag = null;
},
onDraggableTouchStart() {
onDraggableTouchStart(event) {
if (event.touches.length === 1) {
// This prevents an iOS long touch default behavior: selecting
// the nearest selectable text.

2
client/js/helpers/listenForTwoFingerSwipes.js

@ -39,7 +39,7 @@ function listenForTwoFingerSwipes(onTwoFingerSwipe) {
document.body.addEventListener(
"touchend",
function () {
function (event) {
if (event.touches.length >= 2) {
return;
}

Loading…
Cancel
Save