Merge pull request #5187 from fredj/rm_goog.functions

Remove goog.functions.and from ol.interaction.Modify
This commit is contained in:
Frédéric Junod
2016-04-07 12:14:58 +02:00
2 changed files with 13 additions and 7 deletions

View File

@@ -41,8 +41,8 @@ ol.interaction.KeyboardPan = function(opt_options) {
* @return {boolean} Combined condition result.
*/
this.defaultCondition_ = function(mapBrowserEvent) {
return ol.events.condition.noModifierKeys.call(this, mapBrowserEvent) &&
ol.events.condition.targetNotEditable.call(this, mapBrowserEvent)
return ol.events.condition.noModifierKeys(mapBrowserEvent) &&
ol.events.condition.targetNotEditable(mapBrowserEvent);
}
/**

View File

@@ -5,7 +5,6 @@ goog.require('goog.asserts');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.EventType');
goog.require('goog.functions');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.CollectionEventType');
@@ -112,15 +111,22 @@ ol.interaction.Modify = function(options) {
handleUpEvent: ol.interaction.Modify.handleUpEvent_
});
/**
* @private
* @param {ol.MapBrowserEvent} mapBrowserEvent Browser event.
* @return {boolean} Combined condition result.
*/
this.defaultDeleteCondition_ = function(mapBrowserEvent) {
return ol.events.condition.noModifierKeys(mapBrowserEvent) &&
ol.events.condition.singleClick(mapBrowserEvent);
}
/**
* @type {ol.events.ConditionType}
* @private
*/
this.deleteCondition_ = options.deleteCondition ?
options.deleteCondition :
/** @type {ol.events.ConditionType} */ (goog.functions.and(
ol.events.condition.noModifierKeys,
ol.events.condition.singleClick));
options.deleteCondition : this.defaultDeleteCondition_;
/**
* Editing vertex.