「MediaWiki:Gadget-tablesort.js」の版間の差分

No.name2 (トーク | 投稿記録)
data-sort-type="number" の動作をデフォルトに近づける(第6回総選挙#速報発表の不具合を修正)
Motodai (トーク | 投稿記録)
resolve warning
 
85行目: 85行目:
         /* thead要素 */
         /* thead要素 */
         var $thead = $('<thead></thead>');
         var $thead = $('<thead></thead>');
        var setCellSorter = function() {
    var $cell = $(this);
if ($cell.hasClass('unsortable')) {
        $cell.data('sorter', false);
    } else if ($cell.data('sortType') === 'number') {
        $cell.data('sorter', 'number');
    }
};
         while (rows.length) {
         while (rows.length) {
           $tr = $(rows[0]);
           $tr = $(rows[0]);
91行目: 100行目:
             $tr.children().data('sorter', false);
             $tr.children().data('sorter', false);
           } else {
           } else {
            $tr.children().each(function() {
        $tr.children().each(setCellSorter);
              var $cell = $(this);
      }
              if ($cell.hasClass('unsortable')) {
                $cell.data('sorter', false);
              } else if ($cell.data('sortType') === 'number') {
                $cell.data('sorter', 'number');
              }
            });
          }
           $thead.append($tr);
           $thead.append($tr);
         }
         }