| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 Polymer('indeterminate-progress', { | |
| 6 runnerPortion: 20, | |
| 7 rate: 1, | |
| 8 runnerColor: '#0f9d58', | |
| 9 backgroundColor: '#c8c8c8', | |
| 10 | |
| 11 progress: 0, | |
| 12 min: Math.min, | |
| 13 max: Math.max, | |
| 14 | |
| 15 computed: { | |
| 16 scaledProgress: '((100 + runnerPortion) * progress / 100) - runnerPortion', | |
| 17 primaryProgress: 'max(0, scaledProgress)', | |
| 18 secondaryProgress: 'min(scaledProgress + runnerPortion, 100)', | |
| 19 timeout: '20 / min(max(rate, 1), 10)' | |
| 20 }, | |
| 21 | |
| 22 ready: function() { | |
| 23 }, | |
| 24 | |
| 25 doProgress: function() { | |
| 26 if (this.progress + 1 > 100) | |
| 27 this.progress = 0; | |
| 28 else | |
| 29 ++this.progress; | |
| 30 this.async(this.doProgress, null, this.timeout); | |
| 31 } | |
| 32 }); | |
| OLD | NEW |