Docs: add parsed values function no longer wraps empty content

This commit is contained in:
Mottie 2015-08-23 07:16:01 -05:00
parent 0924a98a2b
commit aa315b1e88

View File

@ -216,13 +216,16 @@
// append hidden parsed value to cell
// used by feet-inch-fraction & metric parser demos
window.addParsedValues = function($t, cols, format){
var r,
var r, val,
$r = $t.find('tbody tr'),
c = $t[0].config.cache[0].normalized;
$r.each(function(i){
r = this;
$.each(cols, function(v,j){
r.cells[j].innerHTML += ' <span class="val hidden removeme">(<span class="results">' + (format ? format(c[i][j]) : c[i][j]) + '</span>)</span>';
val = format ? format(c[i][j]) : c[i][j];
if (val !== '') {
r.cells[j].innerHTML += ' <span class="val hidden removeme">(<span class="results">' + val + '</span>)</span>';
}
});
});