Remove LOAD_SUB_FRAME load flag.
[chromium-blink-merge.git] / third_party / polymer / components / paper-progress / paper-progress.html
blobc40a901206ee182cb488678d144ef1f3c212be32
1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 -->
10 <!--
11 The progress bars are for situations where the percentage completed can be
12 determined. They give users a quick sense of how much longer an operation
13 will take.
15 Example:
17 <paper-progress value="10"></paper-progress>
19 There is also a secondary progress which is useful for displaying intermediate
20 progress, such as the buffer level during a streaming playback progress bar.
22 Example:
24 <paper-progress value="10" secondaryProgesss="30"></paper-progress>
26 Styling progress bar:
28 To change the active progress bar color:
30 paper-progress::shadow #activeProgress {
31 background-color: #e91e63;
34 To change the secondary progress bar color:
36 paper-progress::shadow #secondaryProgress {
37 background-color: #f8bbd0;
40 To change the progress bar background color:
42 paper-progress::shadow #progressContainer {
43 background-color: #64ffda;
46 @group Paper Elements
47 @element paper-progress
48 @extends core-range
49 @homepage github.io
50 -->
52 <link rel="import" href="../core-range/core-range.html">
54 <polymer-element name="paper-progress" extends="core-range" attributes="secondaryProgress indeterminate">
56 <template>
58 <link rel="stylesheet" href="paper-progress.css">
60 <div id="progressContainer" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="{{min}}" aria-valuemax="{{max}}">
62 <div id="secondaryProgress" fit></div>
63 <div id="activeProgress" fit></div>
65 </div>
67 </template>
69 <script>
71 Polymer('paper-progress', {
73 /**
74 * The number that represents the current secondary progress.
76 * @attribute secondaryProgress
77 * @type number
78 * @default 0
80 secondaryProgress: 0,
82 /**
83 * Use an indeterminate progress indicator.
85 * @attribute indeterminate
86 * @type boolean
87 * @default false
89 indeterminate: false,
91 step: 0,
93 observe: {
94 'value secondaryProgress min max indeterminate': 'update'
97 update: function() {
98 this.super();
99 this.secondaryProgress = this.clampValue(this.secondaryProgress);
100 this.secondaryRatio = this.calcRatio(this.secondaryProgress) * 100;
102 // If we use attribute/class binding, the animation sometimes doesn't translate properly
103 // on Safari 7.1. So instead, we toggle the class here in the update method.
104 this.$.activeProgress.classList.toggle('indeterminate', this.indeterminate);
107 transformProgress: function(progress, ratio) {
108 var transform = 'scaleX(' + (ratio / 100) + ')';
109 progress.style.transform = progress.style.webkitTransform = transform;
112 ratioChanged: function() {
113 this.transformProgress(this.$.activeProgress, this.ratio);
116 secondaryRatioChanged: function() {
117 this.transformProgress(this.$.secondaryProgress, this.secondaryRatio);
122 </script>
124 </polymer-element>