Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!-- | |
| 2 The common.js file must be included before this file. | |
| 3 | |
| 4 This in an HTML Import-able file that contains the definition | |
| 5 of the following elements: | |
| 6 | |
| 7 <fuzzer-collapse-function-sk> | |
| 8 | |
| 9 To use this file import it: | |
| 10 | |
| 11 <link href="/res/imp/fuzzer-collapse-function-sk.html" rel="import" /> | |
| 12 | |
| 13 Usage: | |
| 14 | |
| 15 <fuzzer-collapse-function-sk></fuzzer-collapse-function-sk> | |
| 16 | |
| 17 Properties: | |
| 18 func - The FunctionDetails object. Expected to have the following attribute s: | |
| 19 functionName: String, | |
| 20 apiCount: Number, | |
| 21 binaryCount: Number, | |
| 22 byLineNumber: Array of Detail objects. See fuzzer-collapse-details-sk.htm l for schema. | |
| 23 | |
| 24 expand: String, which should be "true" if the gui should start expanded | |
| 25 Methods: | |
|
jcgregorio
2015/11/06 18:55:37
Blank line before.
| |
| 26 setFunc(func) - Programmatically set the FunctionDetails object. | |
| 27 toggleLineNumbers() - Programmtically expand/collapse the line number detail s. | |
| 28 | |
| 29 Events: | |
| 30 None. | |
| 31 --> | |
| 32 <link rel="import" href="/res/imp/bower_components/iron-collapse/iron-collapse.h tml"> | |
| 33 <link rel="import" href="fuzzer-collapse-details-sk.html"> | |
| 34 <dom-module id="fuzzer-collapse-function-sk"> | |
| 35 <template> | |
| 36 <style> | |
| 37 #wrapper { | |
| 38 padding: 20px; | |
| 39 border-radius: 10px; | |
| 40 background-color: #E5E5E5; | |
| 41 color: #000000; | |
| 42 } | |
| 43 | |
| 44 #wrapper div { | |
| 45 margin-top: 0px; | |
| 46 } | |
| 47 | |
| 48 #indicator { | |
| 49 cursor: pointer; | |
| 50 margin: 1px 6px 1px 1px; | |
| 51 /*Make the indicator icon a bit smaller than normal*/ | |
| 52 --iron-icon-height: 20px; | |
| 53 --iron-icon-width: 20px; | |
| 54 } | |
| 55 | |
| 56 #indicator.toggled { | |
| 57 transform: rotate(.25turn); | |
| 58 } | |
| 59 | |
| 60 ul { | |
| 61 list-style-type: none; | |
| 62 } | |
| 63 </style> | |
| 64 <div id="wrapper"> | |
| 65 <div> | |
| 66 <iron-icon role="button" id="indicator" icon="icons:send" on-click="togg leLineNumbers" title="Click to toggle line number view"></iron-icon> | |
| 67 <span> | |
| 68 Function {{func.functionName}} -- {{totalCount}} outstanding fuzze s: | |
| 69 {{func.binaryCount}} binary and {{func.apiCount}} api | |
| 70 </span> | |
| 71 </div> | |
| 72 <iron-collapse id="lineNumbers"> | |
| 73 <ul> | |
| 74 <template is="dom-repeat" items="{{func.byLineNumber}}" as="lineNumber "> | |
| 75 <fuzzer-collapse-details-sk details="{{lineNumber}}"></fuzzer-collap se-details-sk> | |
| 76 </template> | |
| 77 </ul> | |
| 78 </iron-collapse> | |
| 79 </div> | |
| 80 </template> | |
| 81 <script> | |
| 82 Polymer({ | |
| 83 is: 'fuzzer-collapse-function-sk', | |
| 84 | |
| 85 properties: { | |
| 86 func: { //expected to be provided | |
| 87 type: Object, | |
| 88 value: function() { | |
| 89 return {}; | |
| 90 } | |
| 91 }, | |
| 92 totalCount: { | |
| 93 type: Number, | |
| 94 computed: "_getTotalCount(func)", | |
| 95 }, | |
| 96 expand: { | |
| 97 type: String, | |
| 98 value: "" | |
| 99 }, | |
| 100 }, | |
| 101 | |
| 102 ready: function() { | |
| 103 if (this.expand) { | |
| 104 this.$.lineNumbers.show(); | |
| 105 this.$.indicator.toggleClass("toggled"); | |
| 106 } | |
| 107 }, | |
| 108 | |
| 109 setFunc: function(func){ | |
| 110 this.func = func; | |
| 111 }, | |
| 112 | |
| 113 _getTotalCount: function(func) { | |
| 114 return func.binaryCount + func.apiCount; | |
| 115 }, | |
| 116 | |
| 117 toggleLineNumbers: function() { | |
| 118 this.$.lineNumbers.toggle(); | |
| 119 this.$.indicator.toggleClass("toggled"); | |
| 120 } | |
| 121 }); | |
| 122 </script> | |
| 123 </dom-module> | |
| OLD | NEW |