Skip to content

Commit

Permalink
Merge pull request #343 from CAE/release/3.2.2
Browse files Browse the repository at this point in the history
Release/3.2.2
  • Loading branch information
Doris Lam authored and GitHub Enterprise committed Jan 13, 2018
2 parents 54e8e2d + 1c16926 commit 30cf36a
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions src/directives/mmsViewTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,27 +249,7 @@ function mmsViewTable($compile, $timeout, $document, UtilsService) {
/** Return the content of a cell given a row & columnIndex **/
function _getCellValueForFiltering(row, columnIndex) {
var cell = $(row).children('td').eq(columnIndex);
var containerDivContent = cell.children('div').contents();
// if there is no content, think of it as empty string
if (containerDivContent.length === 0) {
return '';
} else {
var cf = 'mms-cf';
var contentTagName = containerDivContent.prop('tagName').toLowerCase();
var contentTagAttr = containerDivContent.attr('mms-cf-type');
var textNodeTypeVal = 3;
if (containerDivContent[0].nodeType === textNodeTypeVal || (contentTagName === cf &&
( contentTagAttr === 'name' || contentTagAttr === 'doc' || contentTagAttr === 'val' ) ) ||
contentTagName === 'ol' || contentTagName === 'ul' || contentTagName === 'table'
) {
return cell.text().trim();
// return '' so that images only show up when there is no search term
} else if ( contentTagName === cf && contentTagAttr === 'img' ) {
return '';
} else {
return '';
}
}
return cell.text().trim();
}

/** Clear out filter term(s) for all header's columns that used to be filtered by before **/
Expand Down Expand Up @@ -387,11 +367,10 @@ function mmsViewTable($compile, $timeout, $document, UtilsService) {
var cf = 'mms-cf';
var contentTag = containerDivContent.prop('tagName').toLowerCase();
var contentTagAttr = containerDivContent.attr('mms-cf-type');
var textNodeTypeVal = 3;
if (containerDivContent[0].nodeType === textNodeTypeVal || (contentTag === cf && ( contentTagAttr === 'name' || contentTagAttr === 'doc' || contentTagAttr === 'val' ) )) {
return cell.text().trim();
} else {
if ( contentTag === 'img' || contentTag === 'table' || contentTag === cf && ( contentTagAttr === 'img' || contentTagAttr === 'table' )) {
return null;
} else {
return cell.text().trim();
}
}
}
Expand Down

0 comments on commit 30cf36a

Please sign in to comment.