colSpan: do proper accessing of the property/attribute colSpan
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 6 Jul 2013 11:15:25 +0000 (13:15 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 6 Jul 2013 11:15:25 +0000 (13:15 +0200)
Change-Id: I192a95d2eeca40265156f7a05893ab3006f65ace

tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js

index d23bfc3..494abd8 100644 (file)
                function ( $table ) {
                        // Make colspanned header for test
                        $table.find( 'tr:eq(0) th:eq(1), tr:eq(0) th:eq(2)' ).remove();
-                       $table.find( 'tr:eq(0) th:eq(0)' ).prop( 'colspan', '3' );
+                       $table.find( 'tr:eq(0) th:eq(0)' ).attr( 'colspan', '3' );
 
                        $table.tablesorter();
                        $table.find( '.headerSort:eq(0)' ).click();
                function ( $table ) {
                        // Make colspanned header for test
                        $table.find( 'tr:eq(0) th:eq(1), tr:eq(0) th:eq(2)' ).remove();
-                       $table.find( 'tr:eq(0) th:eq(0)' ).prop( 'colspan', '3' );
+                       $table.find( 'tr:eq(0) th:eq(0)' ).attr( 'colspan', '3' );
 
                        $table.tablesorter();
                        $table.find( '.headerSort:eq(0)' ).click();
                function ( $table ) {
                        // Make colspanned header for test
                        $table.find( 'tr:eq(0) th:eq(1), tr:eq(0) th:eq(2)' ).remove();
-                       $table.find( 'tr:eq(0) th:eq(0)' ).prop( 'colspan', '3' );
+                       $table.find( 'tr:eq(0) th:eq(0)' ).attr( 'colspan', '3' );
 
                        $table.tablesorter();
                        $table.find( '.headerSort:eq(1)' ).click();
                function ( $table ) {
                        // Make colspanned header for test
                        $table.find( 'tr:eq(0) th:eq(1), tr:eq(0) th:eq(2)' ).remove();
-                       $table.find( 'tr:eq(0) th:eq(0)' ).prop( 'colspan', '3' );
+                       $table.find( 'tr:eq(0) th:eq(0)' ).attr( 'colspan', '3' );
 
                        $table.tablesorter();
                        $table.find( '.headerSort:eq(1)' ).click();
                $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
                // - Set rowspan for 2nd cell of 3rd row to 3.
                //   This covers the removed cell in the 4th and 5th row.
-               $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
+               $table.find( 'tr:eq(2) td:eq(1)' ).attr( 'rowspan', '3' );
 
                $table.tablesorter();
 
                assert.equal(
-                       $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan' ),
+                       $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowSpan' ),
                        3,
                        'Rowspan not exploded'
                );
                        $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
                        // - Set rowspan for 2nd cell of 3rd row to 3.
                        //   This covers the removed cell in the 4th and 5th row.
-                       $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
+                       $table.find( 'tr:eq(2) td:eq(1)' ).attr( 'rowspan', '3' );
 
                        $table.tablesorter();
                        $table.find( '.headerSort:eq(0)' ).click();
                        $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
                        // - Set rowspan for 2nd cell of 3rd row to 3.
                        //   This covers the removed cell in the 4th and 5th row.
-                       $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
+                       $table.find( 'tr:eq(2) td:eq(1)' ).attr( 'rowspan', '3' );
 
                        $table.tablesorter( { sortList: [
                                { 0: 'asc' }
                        $table.find( 'tr:eq(3) td:eq(0), tr:eq(4) td:eq(0)' ).remove();
                        // - Set rowspan for 1st cell of 3rd row to 3.
                        //   This covers the removed cell in the 4th and 5th row.
-                       $table.find( 'tr:eq(2) td:eq(0)' ).prop( 'rowspan', '3' );
+                       $table.find( 'tr:eq(2) td:eq(0)' ).attr( 'rowspan', '3' );
 
                        $table.tablesorter();
                        $table.find( '.headerSort:eq(0)' ).click();