Permalink
Browse files

Table: Reflow labels honor <abbr> title

(cherry picked from commit 15f7a67)

Closes gh-7609
Fixes gh-7608
  • Loading branch information...
gabrielschulhof committed Aug 4, 2014
1 parent 0095c40 commit b0b3495497dbd6c95a6983ded91ba9f0558ca2bc
Showing with 25 additions and 0 deletions.
  1. +3 −0 js/widgets/table.reflow.js
  2. +15 −0 tests/unit/table/index.html
  3. +7 −0 tests/unit/table/table_core.js
@@ -80,6 +80,9 @@ $.widget( "mobile.table", $.mobile.table, {
},
_addLabels: function( cells, label, contents ) {
if ( contents.length === 1 && contents[ 0 ].nodeName.toLowerCase() === "abbr" ) {
contents = contents.eq( 0 ).attr( "title" );
}
// .not fixes #6006
cells
.not( ":has(b." + label + ")" )
@@ -129,6 +129,21 @@ <h1>Basic Table</h1>
</tr>
</tbody>
</table>
<table data-nstest-role="table" data-nstest-mode="reflow" id="reflow-abbr-test">
<thead>
<tr>
<th><abbr title="Player Name">PN</abbr></th>
</tr>
</thead>
<tbody>
<tr>
<td id="reflow-abbr-td1">Player I</td>
</tr>
<tr>
<td id="reflow-abbr-td2">Player II</td>
</tr>
</tbody>
</table>
</div>
</div>
@@ -99,6 +99,13 @@
}, 800);
});
test( "Reflow mode honors <abbr> tag title", function() {
var table = $( "#reflow-abbr-test" );
deepEqual( $( "#reflow-abbr-td1 b" ).text(), "Player Name", "Row 1 has the right label" );
deepEqual( $( "#reflow-abbr-td2 b" ).text(), "Player Name", "Row 2 has the right label" );
});
asyncTest( "The appropriate label is added" , function(){
setTimeout(function(){
var $table = $( "#reflow-table-test table" ),

0 comments on commit b0b3495

Please sign in to comment.