Move unsortable class into tablesorter config
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 18 Jul 2013 19:43:15 +0000 (21:43 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 28 Jul 2013 14:20:34 +0000 (16:20 +0200)
Change-Id: I7fc1e9fe9e63128b3c6bac0ec067f1631e53cde2

resources/jquery/jquery.tablesorter.js

index 863d8ec..acf21d6 100644 (file)
                        this.order = 0;
                        this.count = 0;
 
-                       if ( $( this ).is( '.unsortable' ) ) {
+                       if ( $( this ).hasClass( table.config.unsortableClass ) ) {
                                this.sortDisabled = true;
                        }
 
                                sortInitialOrder: 'asc',
                                sortMultiSortKey: 'shiftKey',
                                sortLocaleCompare: false,
+                               unsortableClass: 'unsortable',
                                parsers: {},
                                widgets: [],
                                headers: {},
 
                                        // Apply event handling to headers
                                        // this is too big, perhaps break it out?
-                                       $headers.filter( ':not(.unsortable)' ).on( 'keypress click', function ( e ) {
+                                       $headers.not( '.' + table.config.unsortableClass ).on( 'keypress click', function ( e ) {
                                                if ( e.type === 'click' && 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.