From d517bdc5cd8bc276f08233bdb0e892427650f6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 12 Jul 2012 07:35:14 +0200 Subject: [PATCH] use of goog.events.Event.stopPropagation instead of our own function --- src/ol/control/Attribution.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index 2bcfedc788..9ec0f391b1 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -3,6 +3,8 @@ goog.provide('ol.control.Attribution'); goog.require('ol.control.Control'); goog.require('goog.dom'); +goog.require('goog.events'); +goog.require('goog.events.Event'); /** @@ -42,7 +44,8 @@ ol.control.Attribution.prototype.setMap = function(map) { var staticOverlay = map.getStaticOverlay(); if (goog.isNull(this.container_)) { this.container_ = goog.dom.createDom('div', this.CLS); - goog.events.listen(this.container_, 'click', this.stopEventPropagation); + goog.events.listen(this.container_, 'click', + goog.events.Event.stopPropagation); } if (!goog.isNull(staticOverlay)) { goog.dom.append(staticOverlay, this.container_); @@ -83,16 +86,10 @@ ol.control.Attribution.prototype.update = function() { }; ol.control.Attribution.prototype.destroy = function() { - goog.events.unlisten(this.container_, 'click', this.stopEventPropagation); + goog.events.unlisten(this.container_, 'click', + goog.events.Event.stopPropagation); goog.dom.removeNode(this.container_); goog.base(this, 'destroy'); }; -/** - * @param {goog.events.BrowserEvent} e - */ -ol.control.Attribution.prototype.stopEventPropagation = function(e) { - e.stopPropagation(); -}; - ol.control.addControl('attribution', ol.control.Attribution);