forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracting conditional logic to make code more readable
- Loading branch information
1 parent
1c43563
commit 46aea33
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 11 additions & 1 deletion
12
src/kibana/components/doc_table/components/table_row/cell.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
<td <%= timefield ? 'class="discover-table-timefield" width="1%"' : sourcefield ? 'class="discover-table-sourcefield"' : 'class="discover-table-datafield"' %>> | ||
<% | ||
var attributes = ''; | ||
if (timefield) { | ||
attributes='class="discover-table-timefield" width="1%"'; | ||
} else if (sourcefield) { | ||
attributes='class="discover-table-sourcefield"'; | ||
} else { | ||
attributes='class="discover-table-datafield"'; | ||
} | ||
%> | ||
<td <%= attributes %>> | ||
<%= formatted %> | ||
</td> |