Changeset 468 in tmcsimulator for trunk/webapps/einotebook/scripts/Incident.js
- Timestamp:
- 07/28/2019 05:27:26 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/webapps/einotebook/scripts/Incident.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/scripts/Incident.js
r359 r468 17 17 //========== public methods ==========// 18 18 this.html = html; 19 this.expandAction = expandAction;19 this.setSummary = setSummary; 20 20 21 21 //========== private methods ==========// 22 22 this.formatHeader = formatHeader; 23 this.expandOption = expandOption; 24 this.expandOptionSymbol = expandOptionSymbol; 25 23 24 /** Setter for summary field */ 25 function setSummary(description) 26 { 27 this.summary = description; 28 } 29 30 /** 26 31 /** 27 32 * @return The html representation of this incident; … … 35 40 "<tr>" + 36 41 "<td class='incidentSummary' id='summary" + this.number + "'>" + 37 (this.expanded ? this.summary : "")+ "</td>" +42 this.summary + "</td>" + 38 43 "</tr>" + 39 44 "</table>"; … … 50 55 return "<table class='incidentHeader'>" + 51 56 "<tr class='incidentHeader'>" + 52 "<td class='incidentExpandOption'> " + this.expandOption() + "</td>" +57 "<td class='incidentExpandOption'></td>" + 53 58 "<td class='incidentTime'>Time: " + this.time.format() + "</td>" + 54 59 "<td class='incidentNumber'>" + this.number + "</td>" + … … 58 63 } 59 64 60 /**61 * @return The html that for the + or - symbol that expands or collapses the incident.62 */63 function expandOption()64 {65 return "<button class='incidentExpandButton' " +66 "id='expandOption" + this.number + "' onclick='incidents.get(" +67 this.number + ").expandAction()'>" + this.expandOptionSymbol() +68 "</button>";69 }70 65 71 /**72 * Returns the symbol for the expand option.73 * @return Either "+" or "-" depending on whether this incidents is collapsed or74 * expanded.75 */76 function expandOptionSymbol()77 {78 return this.expanded == true ? "–" : "+";79 }80 81 /**82 * Performs the action of clicking on the + or - symbol that expands or collapses83 * the incident.84 */85 function expandAction()86 {87 if (this.expanded)88 {89 incidents.doc.getElementById("summary" + this.number).innerHTML = "";90 incidents.doc.getElementById("expandOption" + this.number).innerHTML = "+";91 }92 else93 {94 incidents.doc.getElementById("summary" + this.number).innerHTML =95 this.summary;96 incidents.doc.getElementById("expandOption" + this.number).innerHTML =97 "–";98 }99 100 this.expanded = !this.expanded;101 102 }103 66 }
Note: See TracChangeset
for help on using the changeset viewer.
