Skip to content

Commit

Permalink
Remove getter for down_
Browse files Browse the repository at this point in the history
  • Loading branch information
tsauerwein committed Jan 30, 2015
1 parent 9cc8390 commit 9a84158
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
15 changes: 5 additions & 10 deletions src/ol/mapbrowserevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_dragging,
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 stable
*/
Expand Down Expand Up @@ -173,6 +176,8 @@ ol.MapBrowserEventHandler = function(map) {
}

/**
* The most recent "down" type event (or null if none have occurred).
* Set on pointerdown.
* @type {ol.pointer.PointerEvent}
* @private
*/
Expand Down Expand Up @@ -233,16 +238,6 @@ ol.MapBrowserEventHandler = function(map) {
goog.inherits(ol.MapBrowserEventHandler, goog.events.EventTarget);


/**
* Get the last "down" type event. This will be set on pointerdown.
* @return {ol.pointer.PointerEvent} The most recent "down" type event (or null
* if none have occurred).
*/
ol.MapBrowserEventHandler.prototype.getDown = function() {
return this.down_;
};


/**
* @param {goog.events.BrowserEvent} browserEvent Pointer event.
* @private
Expand Down
10 changes: 5 additions & 5 deletions test/spec/ol/mapbrowserevent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,22 @@ describe('ol.MapBrowserEventHandler', function() {

});

describe('#getDown()', function() {
describe('#down_', function() {

var handler;
beforeEach(function() {
handler = new ol.MapBrowserEventHandler(new ol.Map({}));
});

it('returns null if no "down" type event has been handled', function() {
expect(handler.getDown()).to.be(null);
it('is null if no "down" type event has been handled', function() {
expect(handler.down_).to.be(null);
});

it('returns an event after handlePointerDown_ has been called', function() {
it('is an event after handlePointerDown_ has been called', function() {
var event = new ol.pointer.PointerEvent('pointerdown',
new goog.events.BrowserEvent({}));
handler.handlePointerDown_(event);
expect(handler.getDown()).to.be(event);
expect(handler.down_).to.be(event);
});

});
Expand Down

0 comments on commit 9a84158

Please sign in to comment.