Commit 14cbabb8 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[filesapp] Update html.pointer-active on transfer end events

Terminal events of transferController operations (drag-end, touch-end)
should also remove pointer-active from the html element.

Bug: 1062902
Change-Id: I5da0d327b170bf6128ef5b554a692ba9490cdd58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127166Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754741}
parent 37c9d9c8
......@@ -433,11 +433,12 @@ class FileManagerUI {
document.defaultView.addEventListener('resize', this.relayout.bind(this));
// Add global pointer-active handler.
const pointerActiveEvents = window.IN_TEST ?
['pointerdown', 'pointerup', 'mousedown', 'mouseup'] :
['pointerdown', 'pointerup'];
const rootElement = document.documentElement;
pointerActiveEvents.forEach((eventType) => {
let pointerActive = ['pointerdown', 'pointerup', 'dragend', 'touchend'];
if (window.IN_TEST) {
pointerActive = pointerActive.concat(['mousedown', 'mouseup']);
}
pointerActive.forEach((eventType) => {
document.addEventListener(eventType, (e) => {
rootElement.classList.toggle('pointer-active', /down$/.test(e.type));
}, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment