Rename _ol_MapBrowserEvent_ to MapBrowserEvent

This commit is contained in:
Marc Jansen
2017-12-15 09:41:34 +01:00
committed by Frederic Junod
parent a01793d3af
commit 465c248572
6 changed files with 21 additions and 21 deletions

View File

@@ -18,7 +18,7 @@ import MapEvent from './MapEvent.js';
* @param {boolean=} opt_dragging Is the map currently being dragged? * @param {boolean=} opt_dragging Is the map currently being dragged?
* @param {?olx.FrameState=} opt_frameState Frame state. * @param {?olx.FrameState=} opt_frameState Frame state.
*/ */
var _ol_MapBrowserEvent_ = function(type, map, browserEvent, opt_dragging, var MapBrowserEvent = function(type, map, browserEvent, opt_dragging,
opt_frameState) { opt_frameState) {
MapEvent.call(this, type, map, opt_frameState); MapEvent.call(this, type, map, opt_frameState);
@@ -56,7 +56,7 @@ var _ol_MapBrowserEvent_ = function(type, map, browserEvent, opt_dragging,
}; };
inherits(_ol_MapBrowserEvent_, MapEvent); inherits(MapBrowserEvent, MapEvent);
/** /**
@@ -65,7 +65,7 @@ inherits(_ol_MapBrowserEvent_, MapEvent);
* @override * @override
* @api * @api
*/ */
_ol_MapBrowserEvent_.prototype.preventDefault = function() { MapBrowserEvent.prototype.preventDefault = function() {
MapEvent.prototype.preventDefault.call(this); MapEvent.prototype.preventDefault.call(this);
this.originalEvent.preventDefault(); this.originalEvent.preventDefault();
}; };
@@ -77,8 +77,8 @@ _ol_MapBrowserEvent_.prototype.preventDefault = function() {
* @override * @override
* @api * @api
*/ */
_ol_MapBrowserEvent_.prototype.stopPropagation = function() { MapBrowserEvent.prototype.stopPropagation = function() {
MapEvent.prototype.stopPropagation.call(this); MapEvent.prototype.stopPropagation.call(this);
this.originalEvent.stopPropagation(); this.originalEvent.stopPropagation();
}; };
export default _ol_MapBrowserEvent_; export default MapBrowserEvent;

View File

@@ -2,7 +2,7 @@
* @module ol/MapBrowserPointerEvent * @module ol/MapBrowserPointerEvent
*/ */
import {inherits} from './index.js'; import {inherits} from './index.js';
import _ol_MapBrowserEvent_ from './MapBrowserEvent.js'; import MapBrowserEvent from './MapBrowserEvent.js';
/** /**
* @constructor * @constructor
@@ -16,7 +16,7 @@ import _ol_MapBrowserEvent_ from './MapBrowserEvent.js';
var _ol_MapBrowserPointerEvent_ = function(type, map, pointerEvent, opt_dragging, var _ol_MapBrowserPointerEvent_ = function(type, map, pointerEvent, opt_dragging,
opt_frameState) { opt_frameState) {
_ol_MapBrowserEvent_.call(this, type, map, pointerEvent.originalEvent, opt_dragging, MapBrowserEvent.call(this, type, map, pointerEvent.originalEvent, opt_dragging,
opt_frameState); opt_frameState);
/** /**
@@ -27,5 +27,5 @@ var _ol_MapBrowserPointerEvent_ = function(type, map, pointerEvent, opt_dragging
}; };
inherits(_ol_MapBrowserPointerEvent_, _ol_MapBrowserEvent_); inherits(_ol_MapBrowserPointerEvent_, MapBrowserEvent);
export default _ol_MapBrowserPointerEvent_; export default _ol_MapBrowserPointerEvent_;

View File

@@ -4,7 +4,7 @@
import {getUid, inherits} from './index.js'; import {getUid, inherits} from './index.js';
import _ol_Collection_ from './Collection.js'; import _ol_Collection_ from './Collection.js';
import _ol_CollectionEventType_ from './CollectionEventType.js'; import _ol_CollectionEventType_ from './CollectionEventType.js';
import _ol_MapBrowserEvent_ from './MapBrowserEvent.js'; import MapBrowserEvent from './MapBrowserEvent.js';
import _ol_MapBrowserEventHandler_ from './MapBrowserEventHandler.js'; import _ol_MapBrowserEventHandler_ from './MapBrowserEventHandler.js';
import _ol_MapBrowserEventType_ from './MapBrowserEventType.js'; import _ol_MapBrowserEventType_ from './MapBrowserEventType.js';
import MapEvent from './MapEvent.js'; import MapEvent from './MapEvent.js';
@@ -837,7 +837,7 @@ _ol_PluggableMap_.prototype.getTilePriority = function(tile, tileSourceKey, tile
*/ */
_ol_PluggableMap_.prototype.handleBrowserEvent = function(browserEvent, opt_type) { _ol_PluggableMap_.prototype.handleBrowserEvent = function(browserEvent, opt_type) {
var type = opt_type || browserEvent.type; var type = opt_type || browserEvent.type;
var mapBrowserEvent = new _ol_MapBrowserEvent_(type, this, browserEvent); var mapBrowserEvent = new MapBrowserEvent(type, this, browserEvent);
this.handleMapBrowserEvent(mapBrowserEvent); this.handleMapBrowserEvent(mapBrowserEvent);
}; };

View File

@@ -1,5 +1,5 @@
import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_MapBrowserEvent_ from '../../../../src/ol/MapBrowserEvent.js'; import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
import _ol_View_ from '../../../../src/ol/View.js'; import _ol_View_ from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js'; import Event from '../../../../src/ol/events/Event.js';
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js'; import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
@@ -24,7 +24,7 @@ describe('ol.interaction.KeyboardPan', function() {
describe('handleEvent()', function() { describe('handleEvent()', function() {
it('pans on arrow keys', function() { it('pans on arrow keys', function() {
var spy = sinon.spy(_ol_interaction_Interaction_, 'pan'); var spy = sinon.spy(_ol_interaction_Interaction_, 'pan');
var event = new _ol_MapBrowserEvent_('keydown', map, { var event = new MapBrowserEvent('keydown', map, {
type: 'keydown', type: 'keydown',
target: map.getTargetElement(), target: map.getTargetElement(),
preventDefault: Event.prototype.preventDefault preventDefault: Event.prototype.preventDefault

View File

@@ -1,5 +1,5 @@
import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_MapBrowserEvent_ from '../../../../src/ol/MapBrowserEvent.js'; import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
import _ol_View_ from '../../../../src/ol/View.js'; import _ol_View_ from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js'; import Event from '../../../../src/ol/events/Event.js';
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js'; import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
@@ -24,7 +24,7 @@ describe('ol.interaction.KeyboardZoom', function() {
describe('handleEvent()', function() { describe('handleEvent()', function() {
it('zooms on + and - keys', function() { it('zooms on + and - keys', function() {
var spy = sinon.spy(_ol_interaction_Interaction_, 'zoomByDelta'); var spy = sinon.spy(_ol_interaction_Interaction_, 'zoomByDelta');
var event = new _ol_MapBrowserEvent_('keydown', map, { var event = new MapBrowserEvent('keydown', map, {
type: 'keydown', type: 'keydown',
target: map.getTargetElement(), target: map.getTargetElement(),
preventDefault: Event.prototype.preventDefault preventDefault: Event.prototype.preventDefault

View File

@@ -1,5 +1,5 @@
import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_MapBrowserEvent_ from '../../../../src/ol/MapBrowserEvent.js'; import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
import _ol_View_ from '../../../../src/ol/View.js'; import _ol_View_ from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js'; import Event from '../../../../src/ol/events/Event.js';
import _ol_has_ from '../../../../src/ol/has.js'; import _ol_has_ from '../../../../src/ol/has.js';
@@ -43,7 +43,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
}); });
it('works with the defaut value', function(done) { it('works with the defaut value', function(done) {
var event = new _ol_MapBrowserEvent_('mousewheel', map, { var event = new MapBrowserEvent('mousewheel', map, {
type: 'mousewheel', type: 'mousewheel',
target: map.getViewport(), target: map.getViewport(),
preventDefault: Event.prototype.preventDefault preventDefault: Event.prototype.preventDefault
@@ -70,7 +70,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
_ol_has_.FIREFOX = origHasFirefox; _ol_has_.FIREFOX = origHasFirefox;
done(); done();
}); });
var event = new _ol_MapBrowserEvent_('wheel', map, { var event = new MapBrowserEvent('wheel', map, {
type: 'wheel', type: 'wheel',
deltaMode: WheelEvent.DOM_DELTA_PIXEL, deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaY: _ol_has_.DEVICE_PIXEL_RATIO, deltaY: _ol_has_.DEVICE_PIXEL_RATIO,
@@ -89,7 +89,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
_ol_has_.FIREFOX = origHasFirefox; _ol_has_.FIREFOX = origHasFirefox;
done(); done();
}); });
var event = new _ol_MapBrowserEvent_('wheel', map, { var event = new MapBrowserEvent('wheel', map, {
type: 'wheel', type: 'wheel',
deltaMode: WheelEvent.DOM_DELTA_PIXEL, deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaY: 1, deltaY: 1,
@@ -115,7 +115,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
expect(call.args[2]).to.eql([0, 0]); expect(call.args[2]).to.eql([0, 0]);
done(); done();
}); });
var event = new _ol_MapBrowserEvent_('wheel', map, { var event = new MapBrowserEvent('wheel', map, {
type: 'wheel', type: 'wheel',
deltaMode: WheelEvent.DOM_DELTA_LINE, deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaY: 3.714599609375, deltaY: 3.714599609375,
@@ -136,7 +136,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
_ol_has_.SAFARI = origHasSafari; _ol_has_.SAFARI = origHasSafari;
done(); done();
}); });
var event = new _ol_MapBrowserEvent_('mousewheel', map, { var event = new MapBrowserEvent('mousewheel', map, {
type: 'mousewheel', type: 'mousewheel',
wheelDeltaY: -50, wheelDeltaY: -50,
target: map.getViewport(), target: map.getViewport(),
@@ -156,7 +156,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
_ol_has_.SAFARI = origHasSafari; _ol_has_.SAFARI = origHasSafari;
done(); done();
}); });
var event = new _ol_MapBrowserEvent_('mousewheel', map, { var event = new MapBrowserEvent('mousewheel', map, {
type: 'mousewheel', type: 'mousewheel',
wheelDeltaY: -120, wheelDeltaY: -120,
target: map.getViewport(), target: map.getViewport(),