Commit 1c67a2e8 authored by Kristi Park's avatar Kristi Park Committed by Commit Bot

[NTP] Reorder shortcuts on dragstart instead of mousedown

Start the reorder flow on dragstart instead of mousedown. This will
prevent the tile from showing its elevated state when the user clicks
it. As a side effect, the elevated state will not appear until the user
starts dragging the tile.

Screencast: https://drive.google.com/open?id=1Oy6dK-2r8TwdC1XW6ka0LRy676mpDXTG

Bug: 986741
Change-Id: Iada5fefcade302b815b9fbaf1582ae00cac57b24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717146
Auto-Submit: Kristi Park <kristipark@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Reviewed-by: default avatarKyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680593}
parent ffa3032c
...@@ -1096,12 +1096,8 @@ function stopReorder(tile) { ...@@ -1096,12 +1096,8 @@ function stopReorder(tile) {
*/ */
function setupReorder(tile) { function setupReorder(tile) {
// Starts the reorder flow. // Starts the reorder flow.
tile.addEventListener('mousedown', (event) => { tile.addEventListener('dragstart', (event) => {
// Do not reorder if the edit menu was clicked or if ctrl/shift/alt/meta is if (!reordering) {
// also held down.
if (event.button == 0 /* LEFT CLICK */ && !event.ctrlKey &&
!event.shiftKey && !event.altKey && !event.metaKey &&
!event.target.classList.contains(CLASSES.MD_MENU) && !reordering) {
startReorder(tile); startReorder(tile);
} }
}); });
......
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