Rework away static members from pointer related classes

This commit is contained in:
Björn Harrtell
2018-02-24 16:24:53 +01:00
parent 3cbdb208c1
commit 6d1e8cb38b
6 changed files with 104 additions and 108 deletions

View File

@@ -195,6 +195,13 @@ const PointerEvent = function(type, originalEvent, opt_eventDict) {
inherits(PointerEvent, Event);
/**
* Is the `buttons` property supported?
* @type {boolean}
*/
const HAS_BUTTONS = false;
/**
* @private
* @param {Object.<string, ?>} eventDict The event dictionary.
@@ -223,7 +230,7 @@ PointerEvent.prototype.getButtons_ = function(eventDict) {
//
// This is fixed with DOM Level 4's use of buttons
let buttons;
if (eventDict.buttons || PointerEvent.HAS_BUTTONS) {
if (eventDict.buttons || HAS_BUTTONS) {
buttons = eventDict.buttons;
} else {
switch (eventDict.which) {
@@ -256,13 +263,6 @@ PointerEvent.prototype.getPressure_ = function(eventDict, buttons) {
};
/**
* Is the `buttons` property supported?
* @type {boolean}
*/
PointerEvent.HAS_BUTTONS = false;
/**
* Checks if the `buttons` property is supported.
*/