(bug 31514) Followup r99031: allow clicking of links in table headers in a different...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 25 Oct 2011 14:41:58 +0000 (14:41 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 25 Oct 2011 14:41:58 +0000 (14:41 +0000)
resources/jquery/jquery.tablesorter.js

index 3b6de7b..443024b 100644 (file)
                                        cacheRegexs();
 
                                        // Apply event handling to headers
-                                       // this is to big, perhaps break it out?
+                                       // this is too big, perhaps break it out?
                                        $headers.click( function( e ) {
+                                               if ( e.target.nodeName.toLowerCase() == 'a' ) {
+                                                       // The user clicked on a link inside a table header
+                                                       // Do nothing and let the default link click action continue
+                                                       return true;
+                                               }
 
                                                if ( firstTime ) {
                                                        firstTime = false;
                                                        };
                                                        return false;
                                                }
-                                       } )
-                                       // Allow links in headers to be clicked
-                                       .find( 'a' ).click( function( e ) {
-                                               e.stopPropagation();
                                        } );
-
                                } );
                        },