Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 (function() { | |
|
Dan Beam
2016/05/24 18:17:25
\n are well worth the bytes
(function() {
var mi
Navid Zolghadr
2016/05/24 18:38:23
Sure. Done.
| |
| 6 var middleButtonMouseDownTarget = null; | |
| 7 document.addEventListener('mousedown', function(e) { | |
| 8 if (e.button == 1) | |
| 9 middleButtonMouseDownTarget = e.path[0]; | |
| 10 }, true); | |
| 11 document.addEventListener('mouseup', function(e) { | |
| 12 if (e.button == 1) { | |
| 13 if (e.path[0] == middleButtonMouseDownTarget) | |
| 14 e.path[0].dispatchEvent(new MouseEvent('click', e)); | |
| 15 middleButtonMouseDownTarget = null; | |
| 16 } | |
| 17 }, true); | |
| 18 })(); | |
| OLD | NEW |