Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2674)

Unified Diff: Tools/GardeningServer/ui/ct-commit-list.html

Issue 464963003: Move commit list out its own model. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/GardeningServer/ui/ct-commit-list.html
diff --git a/Tools/GardeningServer/ui/ct-commit-list.html b/Tools/GardeningServer/ui/ct-commit-list.html
index 6ff19411001d97a75351606affa88d8304cde383..59c95931b4ee8b05b9025420d7491e0b50fd4327 100644
--- a/Tools/GardeningServer/ui/ct-commit-list.html
+++ b/Tools/GardeningServer/ui/ct-commit-list.html
@@ -6,48 +6,26 @@ found in the LICENSE file.
<link rel="import" href="ct-commit.html">
-<polymer-element name="ct-commit-list" attributes="first last commits" noscript>
+<polymer-element name="ct-commit-list" attributes="commitList">
<template>
<style>
:host {
display: block;
}
</style>
- <template repeat="{{ repository in commits.commits | _repositories }}">
- <template repeat="{{ commit in repository | _commits }}">
+ <template repeat="{{ repository in commitList | _repositories }}">
+ <template repeat="{{ commit in repository.commits }}">
<ct-commit data="{{ commit }}"></ct-commit>
</template>
</template>
</template>
<script>
- Polymer({
- commits: null,
- first: null,
- last: null,
-
- _repositories: function(commits) {
- if (!commits)
- return [];
- return Object.keys(commits).sort();
- },
-
- _commits: function(repository) {
- var commits = [];
- if (!this.first || !this.last)
- return commits;
-
- var first = Number(this.first[repository]);
- var last = Number(this.last[repository]);
- if (first == last)
- return commits;
-
- if (first > last) {
- console.warn('Revision range is backwards, which is invalid:', first, last);
- return commits;
- }
-
- return this.commits.range(repository, first + 1, last);
- },
- });
+ Polymer({
+ _repositories: function() {
+ if (!this.commitList)
+ return [];
+ return this.commitList.repositories();
+ }
+ });
</script>
</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698