Get rid of goog.functions

This commit is contained in:
Björn Harrtell
2016-03-20 19:39:00 +01:00
parent baf5287ad2
commit 44e04be67f
23 changed files with 91 additions and 56 deletions

View File

@@ -4,7 +4,7 @@ goog.provide('ol.interaction.DragAndDrop');
goog.provide('ol.interaction.DragAndDropEvent');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol.functions');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.EventType');
@@ -134,7 +134,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, event) {
* @this {ol.interaction.DragAndDrop}
* @api
*/
ol.interaction.DragAndDrop.handleEvent = goog.functions.TRUE;
ol.interaction.DragAndDrop.handleEvent = ol.functions.TRUE;
/**

View File

@@ -6,6 +6,7 @@ goog.require('ol.Pixel');
goog.require('ol.PreRenderFunction');
goog.require('ol.ViewHint');
goog.require('ol.coordinate');
goog.require('ol.functions');
goog.require('ol.events.condition');
goog.require('ol.interaction.Pointer');
@@ -165,4 +166,4 @@ ol.interaction.DragPan.handleDownEvent_ = function(mapBrowserEvent) {
/**
* @inheritDoc
*/
ol.interaction.DragPan.prototype.shouldStopEvent = goog.functions.FALSE;
ol.interaction.DragPan.prototype.shouldStopEvent = ol.functions.FALSE;

View File

@@ -2,6 +2,7 @@ goog.provide('ol.interaction.DragRotate');
goog.require('ol');
goog.require('ol.ViewHint');
goog.require('ol.functions');
goog.require('ol.events.ConditionType');
goog.require('ol.events.condition');
goog.require('ol.interaction.Interaction');
@@ -128,4 +129,4 @@ ol.interaction.DragRotate.handleDownEvent_ = function(mapBrowserEvent) {
/**
* @inheritDoc
*/
ol.interaction.DragRotate.prototype.shouldStopEvent = goog.functions.FALSE;
ol.interaction.DragRotate.prototype.shouldStopEvent = ol.functions.FALSE;

View File

@@ -14,6 +14,7 @@ goog.require('ol.MapBrowserEvent');
goog.require('ol.MapBrowserEvent.EventType');
goog.require('ol.Object');
goog.require('ol.coordinate');
goog.require('ol.functions');
goog.require('ol.events.condition');
goog.require('ol.geom.Circle');
goog.require('ol.geom.GeometryType');
@@ -741,7 +742,7 @@ ol.interaction.Draw.prototype.extend = function(feature) {
/**
* @inheritDoc
*/
ol.interaction.Draw.prototype.shouldStopEvent = goog.functions.FALSE;
ol.interaction.Draw.prototype.shouldStopEvent = ol.functions.FALSE;
/**

View File

@@ -1,7 +1,6 @@
goog.provide('ol.interaction.KeyboardPan');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.coordinate');
goog.require('ol.events.ConditionType');
@@ -36,14 +35,22 @@ ol.interaction.KeyboardPan = function(opt_options) {
var options = opt_options || {};
/**
* @private
* @param {ol.MapBrowserEvent} mapBrowserEvent Browser event.
* @return {boolean} Combined condition result.
*/
this.defaultCondition_ = function(mapBrowserEvent) {
return ol.events.condition.noModifierKeys.call(this, mapBrowserEvent) &&
ol.events.condition.targetNotEditable.call(this, mapBrowserEvent)
}
/**
* @private
* @type {ol.events.ConditionType}
*/
this.condition_ = options.condition !== undefined ?
options.condition :
goog.functions.and(ol.events.condition.noModifierKeys,
ol.events.condition.targetNotEditable);
options.condition : this.defaultCondition_
/**
* @private
@@ -61,7 +68,6 @@ ol.interaction.KeyboardPan = function(opt_options) {
};
goog.inherits(ol.interaction.KeyboardPan, ol.interaction.Interaction);
/**
* Handles the {@link ol.MapBrowserEvent map browser event} if it was a
* `KeyEvent`, and decides the direction to pan to (if an arrow key was

View File

@@ -1,9 +1,9 @@
goog.provide('ol.interaction.PinchRotate');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.Coordinate');
goog.require('ol.functions');
goog.require('ol.ViewHint');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -170,4 +170,4 @@ ol.interaction.PinchRotate.handleDownEvent_ = function(mapBrowserEvent) {
/**
* @inheritDoc
*/
ol.interaction.PinchRotate.prototype.shouldStopEvent = goog.functions.FALSE;
ol.interaction.PinchRotate.prototype.shouldStopEvent = ol.functions.FALSE;

View File

@@ -1,9 +1,9 @@
goog.provide('ol.interaction.PinchZoom');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.Coordinate');
goog.require('ol.functions');
goog.require('ol.ViewHint');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -153,4 +153,4 @@ ol.interaction.PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
/**
* @inheritDoc
*/
ol.interaction.PinchZoom.prototype.shouldStopEvent = goog.functions.FALSE;
ol.interaction.PinchZoom.prototype.shouldStopEvent = ol.functions.FALSE;

View File

@@ -1,6 +1,5 @@
goog.provide('ol.interaction.Pointer');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.MapBrowserEvent.EventType');
goog.require('ol.MapBrowserPointerEvent');
@@ -150,7 +149,7 @@ ol.interaction.Pointer.handleDragEvent = ol.nullFunction;
* @return {boolean} Capture dragging.
* @this {ol.interaction.Pointer}
*/
ol.interaction.Pointer.handleUpEvent = goog.functions.FALSE;
ol.interaction.Pointer.handleUpEvent = ol.functions.FALSE;
/**
@@ -158,7 +157,7 @@ ol.interaction.Pointer.handleUpEvent = goog.functions.FALSE;
* @return {boolean} Capture dragging.
* @this {ol.interaction.Pointer}
*/
ol.interaction.Pointer.handleDownEvent = goog.functions.FALSE;
ol.interaction.Pointer.handleDownEvent = ol.functions.FALSE;
/**
@@ -215,4 +214,6 @@ ol.interaction.Pointer.handleEvent = function(mapBrowserEvent) {
* @return {boolean} Should the event be stopped?
* @protected
*/
ol.interaction.Pointer.prototype.shouldStopEvent = goog.functions.identity;
ol.interaction.Pointer.prototype.shouldStopEvent = function(handled) {
return handled;
};

View File

@@ -4,7 +4,7 @@ goog.provide('ol.interaction.SelectEventType');
goog.provide('ol.interaction.SelectFilterFunction');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol.functions');
goog.require('ol.CollectionEventType');
goog.require('ol.Feature');
goog.require('ol.array');
@@ -148,7 +148,7 @@ ol.interaction.Select = function(opt_options) {
* @type {ol.interaction.SelectFilterFunction}
*/
this.filter_ = options.filter ? options.filter :
goog.functions.TRUE;
ol.functions.TRUE;
var featureOverlay = new ol.layer.Vector({
source: new ol.source.Vector({
@@ -190,7 +190,7 @@ ol.interaction.Select = function(opt_options) {
};
}
} else {
layerFilter = goog.functions.TRUE;
layerFilter = ol.functions.TRUE;
}
/**

View File

@@ -16,6 +16,7 @@ goog.require('ol.events.EventType');
goog.require('ol.extent');
goog.require('ol.geom.Geometry');
goog.require('ol.interaction.Pointer');
goog.require('ol.functions');
goog.require('ol.object');
goog.require('ol.source.Vector');
goog.require('ol.source.VectorEvent');
@@ -49,7 +50,7 @@ ol.interaction.Snap = function(opt_options) {
goog.base(this, {
handleEvent: ol.interaction.Snap.handleEvent_,
handleDownEvent: goog.functions.TRUE,
handleDownEvent: ol.functions.TRUE,
handleUpEvent: ol.interaction.Snap.handleUpEvent_
});
@@ -364,7 +365,7 @@ ol.interaction.Snap.prototype.setMap = function(map) {
/**
* @inheritDoc
*/
ol.interaction.Snap.prototype.shouldStopEvent = goog.functions.FALSE;
ol.interaction.Snap.prototype.shouldStopEvent = ol.functions.FALSE;
/**