From 30249ab572ab26ae3b0d9873d393cd4cb415a9f6 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 11 Sep 2011 20:38:54 -0400 Subject: [PATCH] Improve delegation/change tests to display event firing order and duplicate events. --- test/delegatetest.html | 396 +++++++++++++++++------------------------ 1 file changed, 163 insertions(+), 233 deletions(-) diff --git a/test/delegatetest.html b/test/delegatetest.html index 2483063ae..6938f7e1f 100644 --- a/test/delegatetest.html +++ b/test/delegatetest.html @@ -1,157 +1,103 @@ + - - - - - -

Change Tests

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Change each: - - - - - - - -
- -
- - -
-
-
-
-
-
- -
- -
- - -
- - - - - - - $(document).bind('change')
- $(document).bind('click') -
Live:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREADOCUMENT
Bind:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREA
Focusin:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREADOCUMENT
Focusout:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREADOCUMENT
Live Focus:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREA
Live Blur:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREA
Live Click:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREADOCUMENT
+ +Change Tests + + + + +

Delegate Tests (BAD FILE IN URL, x)

+ + + + + + + + + + + + + + + + + + +
+ Controls: + + + + + + + +
+ +
+ + +
+
+
+
+
+
+ +
+ +
+ + +
+ + + + + + +
+

NOTE: Only IE supports beforeactivate/beforedeactivate; buttons do not support change events.

+

Submit Tests

@@ -184,92 +130,76 @@
- + - +jQuery.fn.addSubmitTest = function( id, prevent ) { + return this.live("submit", function(e){ + if ( prevent ) { + e.preventDefault(); + } + jQuery(id).blink(); + }); +}; + +$("#text_submit").addSubmitTest("#textSubmit", true); +$("#password_submit").addSubmitTest("#passwordSubmit", true); +$("#submit_submit").addSubmitTest("#submitSubmit", true); +$(document).bind("submit", function(){ + jQuery("#boundSubmit").blink(); +}); + + +