Skip to content

Commit

Permalink
Extracting conditional logic to make code more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Jun 4, 2015
1 parent 1c43563 commit 46aea33
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/kibana/components/doc_table/components/table_row/cell.html
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>

0 comments on commit 46aea33

Please sign in to comment.