Extracting conditional logic to make code more readable
This commit is contained in:
parent
1c43563653
commit
46aea33811
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue