Phi: distinguish between normal and abormal checklists
This commit is contained in:
parent
470ee7a80b
commit
7202e25099
2 changed files with 5 additions and 2 deletions
|
@ -9,7 +9,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div id='checklists' data-bind="foreach: checklists">
|
<div id='checklists' data-bind="foreach: checklists">
|
||||||
<h4 data-bind="text: title"></h4>
|
<h4 data-bind="text: title, css: { 'ui-state-error': abnormal }"></h4>
|
||||||
<ul data-bind="foreach: items">
|
<ul data-bind="foreach: items">
|
||||||
<li><span class="phi-checklist-col1" data-bind="text: name"></span> <span class="phi-checklist-col2"
|
<li><span class="phi-checklist-col1" data-bind="text: name"></span> <span class="phi-checklist-col2"
|
||||||
data-bind="text: value"></span></li>
|
data-bind="text: value"></span></li>
|
||||||
|
|
|
@ -15,12 +15,15 @@ define([
|
||||||
if (prop.name === 'checklist') {
|
if (prop.name === 'checklist') {
|
||||||
var checklist = {
|
var checklist = {
|
||||||
title : 'unnamed',
|
title : 'unnamed',
|
||||||
|
abnormal: false,
|
||||||
items : []
|
items : []
|
||||||
};
|
};
|
||||||
checklists.push(checklist);
|
checklists.push(checklist);
|
||||||
prop.children.forEach(function(prop) {
|
prop.children.forEach(function(prop) {
|
||||||
if (prop.name === 'title') {
|
if (prop.name === 'title') {
|
||||||
checklist.title = prop.value;
|
checklist.title = prop.value;
|
||||||
|
} else if (prop.name === 'type') {
|
||||||
|
checklist.abnormal = ( "abnormal" == prop.value );
|
||||||
} else if (prop.name == 'item') {
|
} else if (prop.name == 'item') {
|
||||||
var item = {
|
var item = {
|
||||||
name : 'unnamed',
|
name : 'unnamed',
|
||||||
|
|
Loading…
Add table
Reference in a new issue