Parsers: Add image alt parser

This commit is contained in:
Mottie 2014-07-11 14:59:57 -05:00
parent 4f29e36f12
commit 26493ec8bc

View File

@ -0,0 +1,20 @@
/*! image alt attribute parser for jQuery 1.7+ & tablesorter 2.7.11+
* New 7/8/2014 (v2.17.4)
*/
/*jshint jquery:true, unused:false */
;(function($){
"use strict";
$.tablesorter.addParser({
id: "image",
is: function(){
return false;
},
format: function(s, table, cell) {
return $(cell).find('img').attr(table.config.imgAttr || 'alt') || s;
},
parsed : true, // filter widget flag
type: "text"
});
})(jQuery);