aboutsummaryrefslogtreecommitdiffstats
path: root/src/event
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-06-30 13:57:49 +0000
committerJohn Resig <jeresig@gmail.com>2007-06-30 13:57:49 +0000
commitaf329ed00b0499a8d393f132d2765d02144f6820 (patch)
tree2cb37767bafe324ed42b1249b039b7f111a57c43 /src/event
parent62ae0eff503e7d1e99873db13efe49f634d176d0 (diff)
downloadjquery-af329ed00b0499a8d393f132d2765d02144f6820.tar.gz
jquery-af329ed00b0499a8d393f132d2765d02144f6820.zip
Did some minor tidying up.
Diffstat (limited to 'src/event')
-rw-r--r--src/event/event.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/event/event.js b/src/event/event.js
index 52416e0fa..5d8e89aa8 100644
--- a/src/event/event.js
+++ b/src/event/event.js
@@ -64,7 +64,7 @@ jQuery.event = {
// And bind the global event handler to the element
if (element.addEventListener)
element.addEventListener(type, element.$handle, false);
- else if (element.attachEvent)
+ else
element.attachEvent("on" + type, element.$handle);
}
@@ -112,7 +112,7 @@ jQuery.event = {
if ( !ret ) {
if (element.removeEventListener)
element.removeEventListener(type, element.$handle, false);
- else if (element.detachEvent)
+ else
element.detachEvent("on" + type, element.$handle);
ret = null;
delete events[type];
@@ -227,8 +227,8 @@ jQuery.event = {
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
var e = document.documentElement, b = document.body;
- event.pageX = event.clientX + (e && e.scrollLeft || b && b.scrollLeft);
- event.pageY = event.clientY + (e && e.scrollTop || b && b.scrollTop);
+ event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft);
+ event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop);
}
// Add which for key events
@@ -539,10 +539,9 @@ jQuery.fn.extend({
f.apply( document, [jQuery] );
// Otherwise, remember the function for later
- else {
+ else
// Add the function to the wait list
jQuery.readyList.push( function() { return f.apply(this, [jQuery]) } );
- }
return this;
}