Automated class transform

npx lebab --replace src --transform class
This commit is contained in:
Tim Schaub
2018-07-16 16:18:16 -06:00
parent 60e85e7d89
commit 7b4a73f3b9
145 changed files with 32887 additions and 33714 deletions

View File

@@ -17,66 +17,68 @@ import MapEvent from './MapEvent.js';
* @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
*/
const MapBrowserEvent = function(type, map, browserEvent, opt_dragging, opt_frameState) {
class MapBrowserEvent {
constructor(type, map, browserEvent, opt_dragging, opt_frameState) {
MapEvent.call(this, type, map, opt_frameState);
MapEvent.call(this, type, map, opt_frameState);
/**
* The original browser event.
* @const
* @type {Event}
* @api
*/
this.originalEvent = browserEvent;
/**
* The original browser event.
* @const
* @type {Event}
* @api
*/
this.originalEvent = browserEvent;
/**
* The map pixel relative to the viewport corresponding to the original browser event.
* @type {module:ol~Pixel}
* @api
*/
this.pixel = map.getEventPixel(browserEvent);
/**
* The map pixel relative to the viewport corresponding to the original browser event.
* @type {module:ol~Pixel}
* @api
*/
this.pixel = map.getEventPixel(browserEvent);
/**
* The coordinate in view projection corresponding to the original browser event.
* @type {module:ol/coordinate~Coordinate}
* @api
*/
this.coordinate = map.getCoordinateFromPixel(this.pixel);
/**
* The coordinate in view projection corresponding to the original browser event.
* @type {module:ol/coordinate~Coordinate}
* @api
*/
this.coordinate = map.getCoordinateFromPixel(this.pixel);
/**
* Indicates if the map is currently being dragged. Only set for
* `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.
*
* @type {boolean}
* @api
*/
this.dragging = opt_dragging !== undefined ? opt_dragging : false;
/**
* Indicates if the map is currently being dragged. Only set for
* `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.
*
* @type {boolean}
* @api
*/
this.dragging = opt_dragging !== undefined ? opt_dragging : false;
};
}
/**
* Prevents the default browser action.
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault
* @override
* @api
*/
preventDefault() {
MapEvent.prototype.preventDefault.call(this);
this.originalEvent.preventDefault();
}
/**
* Prevents further propagation of the current event.
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
* @override
* @api
*/
stopPropagation() {
MapEvent.prototype.stopPropagation.call(this);
this.originalEvent.stopPropagation();
}
}
inherits(MapBrowserEvent, MapEvent);
/**
* Prevents the default browser action.
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault
* @override
* @api
*/
MapBrowserEvent.prototype.preventDefault = function() {
MapEvent.prototype.preventDefault.call(this);
this.originalEvent.preventDefault();
};
/**
* Prevents further propagation of the current event.
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
* @override
* @api
*/
MapBrowserEvent.prototype.stopPropagation = function() {
MapEvent.prototype.stopPropagation.call(this);
this.originalEvent.stopPropagation();
};
export default MapBrowserEvent;