Fixed bug #147, required some (ugly) modifications: changed function jQuery(...)...
[jquery.git] / src / jquery / jquery.js
index 041b262..9b5bf8d 100644 (file)
@@ -28,7 +28,7 @@ window.undefined = window.undefined;
  * @name jQuery
  * @cat Core
  */
-function jQuery(a,c) {
+jQuery = function(a,c) {
 
        // Shortcut for document ready (because $(document).each() is silly)
        if ( a && a.constructor == Function && jQuery.fn.ready )
@@ -67,7 +67,7 @@ function jQuery(a,c) {
        // If so, execute it in context
        if ( fn && fn.constructor == Function )
                this.each(fn);
-}
+};
 
 // Map over the $ in case of overwrite
 if ( typeof $ != "undefined" )
@@ -390,6 +390,8 @@ jQuery.fn = jQuery.prototype = {
         * @test ok( $('#en').attr('lang') == "en", 'Check for lang attribute' );
         * @test ok( $('#simon').attr('class') == "blog link", 'Check for class attribute' );
         * @test ok( $('#name').attr('name') == "name", 'Check for name attribute' );
+        * @test ok( $('#text1').attr('name') == "action", 'Check for name attribute' );
+        * @test ok( $('#form').attr('action') == "formaction", 'Check for action attribute' );
         * 
         * @name attr
         * @type Object
@@ -1631,6 +1633,11 @@ jQuery.extend({
         * @test t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2","name"] );
         * @test t( "Is Hidden", "input:hidden", ["hidden1","hidden2"] );
         *
+        * @test t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] );
+        *
+        * @test t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"]  );
+        * @test t( "All Children of ID with no children", "#firstUL/*", []  );
+        *
         * @name $.find
         * @type Array<Element>
         * @private
@@ -2124,8 +2131,11 @@ jQuery.extend({
 
                        var c = this.events[event.type];
 
+                       var args = [].slice.call( arguments, 1 );
+                       args.unshift( event );
+
                        for ( var j in c ) {
-                               if ( c[j].apply( this, [event] ) === false ) {
+                               if ( c[j].apply( this, args ) === false ) {
                                        event.preventDefault();
                                        event.stopPropagation();
                                        returnValue = false;