Only export handleEvent where it is used by other interactions

This commit is contained in:
Tim Schaub
2018-02-19 13:56:41 -07:00
parent bca8938a02
commit 1be61fdb09
11 changed files with 35 additions and 50 deletions

View File

@@ -26,7 +26,7 @@ import Interaction from '../interaction/Interaction.js';
const KeyboardZoom = function(opt_options) {
Interaction.call(this, {
handleEvent: KeyboardZoom.handleEvent
handleEvent: handleEvent
});
const options = opt_options ? opt_options : {};
@@ -61,9 +61,8 @@ inherits(KeyboardZoom, Interaction);
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} `false` to stop event propagation.
* @this {ol.interaction.KeyboardZoom}
* @api
*/
KeyboardZoom.handleEvent = function(mapBrowserEvent) {
function handleEvent(mapBrowserEvent) {
let stopEvent = false;
if (mapBrowserEvent.type == EventType.KEYDOWN ||
mapBrowserEvent.type == EventType.KEYPRESS) {
@@ -81,5 +80,6 @@ KeyboardZoom.handleEvent = function(mapBrowserEvent) {
}
}
return !stopEvent;
};
}
export default KeyboardZoom;