events.js cleanup: more ifs without brackets

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2989 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-04-03 01:42:21 +00:00
parent 7aac1c1cfe
commit 9aa92d491c

View File

@@ -132,8 +132,9 @@ OpenLayers.Event = {
if (name == 'keypress' &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.attachEvent))
|| element.attachEvent)) {
name = 'keydown';
}
this._observeAndCache(element, name, observer, useCapture);
},
@@ -341,14 +342,17 @@ OpenLayers.Events.prototype = {
// if eventTypes is specified, create a listeners list for each
// custom application event.
if (this.eventTypes != null)
for (var i = 0; i < this.eventTypes.length; i++)
if (this.eventTypes != null) {
for (var i = 0; i < this.eventTypes.length; i++) {
this.listeners[ this.eventTypes[i] ] = new Array();
}
}
// if a dom element is specified, add a listeners list
// for browser events on the element and register them
if (this.element != null)
if (this.element != null) {
this.attachToElement(element);
}
},
/**
@@ -376,9 +380,10 @@ OpenLayers.Events.prototype = {
// every browser event has a corresponding application event
// (whether it's listened for or not).
if (this.listeners[eventType] == null)
if (this.listeners[eventType] == null) {
this.listeners[eventType] = new Array();
}
// use Prototype to register the event cross-browser
OpenLayers.Event.observe(element, eventType, this.eventHandler);
}