tablesorter/js/parsers/parser-image.js

20 lines
449 B
JavaScript
Raw Normal View History

/*! Parser: image - new 7/17/2014 (v2.17.5) */
/* alt attribute parser for jQuery 1.7+ & tablesorter 2.7.11+ */
2014-07-11 19:59:57 +00:00
/*jshint jquery:true, unused:false */
;(function($){
'use strict';
2014-07-11 19:59:57 +00:00
$.tablesorter.addParser({
id: 'image',
2014-07-11 19:59:57 +00:00
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'
2014-07-11 19:59:57 +00:00
});
})(jQuery);