Add method to bind bluring on mouseout/focusout
This commit is contained in:
@@ -3,6 +3,7 @@ goog.provide('ol.control.Control');
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.Object');
|
||||
|
||||
@@ -78,6 +79,24 @@ ol.control.Control = function(options) {
|
||||
goog.inherits(ol.control.Control, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
* Bind a listener that blurs the passed element on any mouseout- or
|
||||
* focusout-event.
|
||||
*
|
||||
* @param {!Element} button The button which shall blur on mouseout- or
|
||||
* focusout-event.
|
||||
* @protected
|
||||
*/
|
||||
ol.control.Control.bindMouseOutFocusOutBlur = function(button) {
|
||||
goog.events.listen(button, [
|
||||
goog.events.EventType.MOUSEOUT,
|
||||
goog.events.EventType.FOCUSOUT
|
||||
], /** @this {Element} */ function() {
|
||||
this.blur();
|
||||
}, false);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user