Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!-- | |
| 2 This in an HTML Import-able file that contains the definition | |
| 3 of the following elements: | |
| 4 | |
| 5 <task-retry-prompt> | |
| 6 | |
| 7 To use this file import it: | |
| 8 | |
| 9 <link href="/res/imp/task-retry-prompt" rel="import" /> | |
| 10 | |
| 11 Usage: | |
| 12 | |
| 13 <task-retry-prompt></task-retry-prompt> | |
| 14 | |
| 15 Properties: | |
| 16 None. | |
| 17 | |
| 18 Methods: | |
| 19 setDimensions() | |
| 20 | |
| 21 Events: | |
| 22 None. | |
| 23 --> | |
| 24 | |
| 25 <link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html" > | |
| 26 | |
| 27 <dom-module id="task-retry-prompt"> | |
| 28 <template> | |
| 29 <style> | |
| 30 :host { | |
| 31 display: block; | |
| 32 } | |
| 33 th, td{ | |
| 34 font-size: 16px; | |
| 35 } | |
| 36 paper-input { | |
| 37 --paper-input-container-input: { | |
| 38 font-family: sans-serif; | |
| 39 }; | |
| 40 } | |
| 41 </style> | |
| 42 | |
| 43 <h2>Are you sure you want to retry task [[task_id]]?</h2> | |
| 44 | |
| 45 <div>If you want to modify any dimensions (e.g. specify a bot's id), do so now .</div> | |
| 46 | |
| 47 <table> | |
| 48 <thead> | |
| 49 <tr> | |
| 50 <th>Key</th> | |
| 51 <th>Value</th> | |
| 52 </tr> | |
| 53 </thead> | |
| 54 <tbody> | |
| 55 <template is="dom-repeat" items="[[task_dimensions]]" as="dim"> | |
| 56 <tr> | |
| 57 <td> | |
| 58 <paper-input | |
| 59 no-label-float=true | |
| 60 value="[[dim.key]]" | |
| 61 on-change="_updateKey"> | |
| 62 </paper-input> | |
| 63 </td> | |
| 64 <td> | |
| 65 <paper-input | |
| 66 no-label-float=true | |
| 67 value="[[dim.value]]" | |
| 68 on-change="_updateValue"> | |
| 69 </paper-input> | |
| 70 </td> | |
| 71 </tr> | |
| 72 </template> | |
| 73 | |
| 74 </tbody> | |
| 75 </table> | |
| 76 | |
| 77 </template> | |
| 78 <script> | |
| 79 Polymer({ | |
| 80 is: "task-retry-prompt", | |
| 81 properties: { | |
| 82 task_id: { | |
| 83 type: String, | |
| 84 }, | |
| 85 task_dimensions: { | |
| 86 type: Array, | |
| 87 notify: true, | |
| 88 } | |
| 89 }, | |
| 90 | |
| 91 setDimensions: function(dims) { | |
| 92 dims = dims || []; | |
| 93 while (dims.length < 6) { | |
| 94 dims.push({key:"", value: ""}); | |
| 95 } | |
| 96 this.set("task_dimensions", dims); | |
| 97 }, | |
| 98 | |
| 99 _updateKey: function(e) { | |
| 100 this.set("task_dimensions."+e.model.index+".key", e.currentTarget.value) | |
| 101 }, | |
| 102 | |
| 103 _updateValue: function(e) { | |
| 104 this.set("task_dimensions."+e.model.index+".value", e.currentTarget.valu e) | |
|
stephana
2017/04/10 14:54:05
nit: consider breaking up line.
kjlubick
2017/04/10 15:02:36
Done.
| |
| 105 } | |
| 106 }); | |
| 107 </script> | |
| 108 </dom-module> | |
| OLD | NEW |