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

Unified Diff: dashboard/dashboard/elements/revision-picker.html

Issue 2588203002: Added in a revision picker with dummy data (Closed)
Patch Set: figuring out what is on this branch Created 3 years, 11 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
« no previous file with comments | « no previous file | dashboard/dashboard/elements/speed-releasing-page.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/elements/revision-picker.html
diff --git a/dashboard/dashboard/elements/revision-picker.html b/dashboard/dashboard/elements/revision-picker.html
new file mode 100644
index 0000000000000000000000000000000000000000..e58ef0ce1e5a57e648e97539b7759eb72c2a9cf8
--- /dev/null
+++ b/dashboard/dashboard/elements/revision-picker.html
@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<!--
+Copyright 2016 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+
+<link rel="import" href="/components/iron-flex-layout/iron-flex-layout-classes.html">
+<link rel="import" href="/components/paper-button/paper-button.html">
+<link rel="import" href="/components/paper-icon-button/paper-icon-button.html">
+<link rel="import" href="/components/paper-progress/paper-progress.html">
+
+<link rel="import" href="/dashboard/elements/autocomplete-box.html">
+<link rel="import" href="/dashboard/static/simple_xhr.html">
+<link rel="import" href="/dashboard/static/testselection.html">
+
+<dom-module id="revision-picker">
+ <template>
+ <style include="iron-flex iron-flex-alignment">
+ #container * {
+ margin-right: 3px;
+ }
+
+ #dnd-btn {
+ padding: 1px 2px;
+ margin: 2px 4px 2px 2px;
+ font-size: 11px;
+ cursor:grabbing;
+ cursor:-moz-grabbing;
+ cursor:-webkit-grabbing;
+ }
+
+ paper-button {
+ height: 35px;
+ }
+
+ paper-button:not([disabled]) {
+ color: #4285f4;
+ }
+
+ paper-button[raised]:not([disabled]) {
+ background: #4285f4;
+ color: #fff;
+ }
+
+ iron-icon {
+ height: 25px;
+ }
+
+ #suite-description {
+ padding: 10px;
+ }
+
+ #loading {
+ display: block;
+ position: relative;
+ width: 152px;
+ height: 35px;
+ }
+
+ paper-progress {
+ display: block;
+ position: absolute;
+ bottom: -1px;
+ height: 1px;
+ width: 100%;
+ }
+ </style>
+
+ <div id="container" class="layout horizontal center wrap">
+ <template is="dom-repeat" items="{{selectionModels}}">
+ <autocomplete-box datalist={{item.datalist}}
+ placeholder="{{item.placeholder}}"
+ disabled={{item.disabled}}
+ multi={{item.multi}}
+ on-dropdownselect="onDropdownSelect"
+ id="selection-{{index}}"></autocomplete-box>
+ </template>
+
+ <template is="dom-if" if="{{loading}}">
+ <div id="loading">
+ <paper-progress indeterminate></paper-progress>
+ </div>
+ </template>
+
+ <paper-button raised
+ id="add-graph-btn"
+ on-click=""
+ disabled$="{{!enableAddSeries}}">Add</paper-button>
+ </div>
+
+ <div id="suite-description"></div>
+ </template>
+
+ <script>
+ 'use strict';
+
+ Polymer({
+
+ is: 'revision-picker',
+ properties: {
+
+ selectionModels: {
+ type: Array,
+ value: () => ([
+ {
+ datalist: undefined,
+ placeholder: 'Revision Start',
+ },
+ {
+ datalist: undefined,
+ placeholder: 'Revision End',
+ }
+ ])
+ },
+ xsrfToken: { notify: true }
+ },
+
+ ready: function() {
+ var revisions = this.getRevisions();
+ this.set('selectionModels.0.datalist', revisions);
+ this.set('selectionModels.1.datalist', revisions);
+ this.getSelectionMenu(0).items = this.selectionModels[0].datalist;
+ console.log(this.selectionModels);
+
+ },
+
+ onDropdownSelect: function(event) {
+ console.log('winner winner chicken dinner');
+ },
+
+ getRevisions: function() {
+ var revisionItems = [];
+ for (var i = 0; i < 1000; i++) {
+ var revisionInfo = {
+ name: i,
+ tag: 'hi'
+ };
+ revisionItems.push(revisionInfo);
+ }
+ return revisionItems;
+ },
+
+ getSelectionMenu: function(index) {
+ Polymer.dom.flush();
+ return Polymer.dom(this.$.container).children[index];
+ },
+
+
+ });
+ </script>
+</dom-module>
« no previous file with comments | « no previous file | dashboard/dashboard/elements/speed-releasing-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698