mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Parsers: Add image alt parser
This commit is contained in:
parent
4f29e36f12
commit
26493ec8bc
20
js/parsers/parser-image.js
Normal file
20
js/parsers/parser-image.js
Normal 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);
|
Loading…
Reference in New Issue
Block a user