diff options
| author | Hunternif | 2019-04-22 01:43:00 +0700 |
|---|---|---|
| committer | Hunternif | 2019-04-22 22:16:21 +0700 |
| commit | 998f1a58b49130203400b996fa413b16ccf6df05 (patch) | |
| tree | 6bd4de04976269b7a520c409e19fccae12ea1b8a /client/js/models/post_metric_list.js | |
| parent | 0689ea185bc8fc44f769b106ae42c6c3869bd587 (diff) | |
client: ui to create exact value post metric
Diffstat (limited to 'client/js/models/post_metric_list.js')
| -rw-r--r-- | client/js/models/post_metric_list.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/js/models/post_metric_list.js b/client/js/models/post_metric_list.js index 44f39f4..5e2c838 100644 --- a/client/js/models/post_metric_list.js +++ b/client/js/models/post_metric_list.js @@ -4,6 +4,18 @@ const AbstractList = require('./abstract_list.js'); const PostMetric = require('./post_metric.js'); class PostMetricList extends AbstractList { + findByTagName(testName) { + for (let postMetric of this._list) { + if (postMetric.tagName.toLowerCase() === testName.toLowerCase()) { + return postMetric; + } + } + return null; + } + + hasTagName(testName) { + return !!this.findByTagName(testName); + } } PostMetricList._itemClass = PostMetric; |