1 /* ************************************************************************
3 qooxdoo - the new era of web development
8 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org
11 LGPL: http://www.gnu.org/licenses/lgpl.html
12 EPL: http://www.eclipse.org/org/documents/epl-v10.php
13 See the LICENSE file in the project's top-level directory for details.
16 * Sebastian Werner (wpbasti)
17 * Andreas Ecker (ecker)
19 ************************************************************************ */
21 /* ************************************************************************
24 #require(qx.core.Client)
26 ************************************************************************ */
28 qx.OO.defineClass("qx.html.EventRegistration");
31 * Assign a function to an event.
33 * @param vElement {Element} DOM Element
34 * @param vType {String} Name of the event
35 * @param vFunction {Function} The pointer to the function to assign
37 qx.html.EventRegistration.addEventListener = function(vElement, vType, vFunction) {};
40 * Unassign a function from an event.
42 * @param vElement {Element} DOM Element
43 * @param vType {String} Name of the event
44 * @param vFunction {Function} The pointer to the function to assign
46 qx.html.EventRegistration.removeEventListener = function(vElement, vType, vFunction) {};
48 if (qx.core.Client.getInstance().isMshtml())
50 qx.html.EventRegistration.addEventListener = function(vElement, vType, vFunction) {
51 vElement.attachEvent("on" + vType, vFunction);
54 qx.html.EventRegistration.removeEventListener = function(vElement, vType, vFunction) {
55 vElement.detachEvent("on" + vType, vFunction);
60 qx.html.EventRegistration.addEventListener = function(vElement, vType, vFunction) {
61 vElement.addEventListener(vType, vFunction, false);
64 qx.html.EventRegistration.removeEventListener = function(vElement, vType, vFunction) {
65 vElement.removeEventListener(vType, vFunction, false);