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

Side by Side Diff: polymer_0.5.4/bower_components/paper-slider/paper-slider.html

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 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.g ithub.io/LICENSE.txt 3 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.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/CONTRI BUTORS.txt 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
6 Code distributed by Google as part of the polymer project is also 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/PATEN TS.txt 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
8 --> 8 -->
9 9
10 <!-- 10 <!--
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 editable: false, 182 editable: false,
183 183
184 /** 184 /**
185 * The immediate value of the slider. This value is updated while the user 185 * The immediate value of the slider. This value is updated while the user
186 * is dragging the slider. 186 * is dragging the slider.
187 * 187 *
188 * @attribute immediateValue 188 * @attribute immediateValue
189 * @type number 189 * @type number
190 * @default 0 190 * @default 0
191 */ 191 */
192 maxMarkers: 100,
192 193
193 maxMarkers: 100, 194 /**
194 195 * True when the user is dragging the slider.
196 *
197 * @attribute dragging
198 * @type boolean
199 * @default false
200 */
201 dragging: false,
202
195 observe: { 203 observe: {
196 'step snaps': 'update' 204 'step snaps': 'update'
197 }, 205 },
198 206
199 ready: function() { 207 ready: function() {
200 this.update(); 208 this.update();
201 }, 209 },
202 210
203 update: function() { 211 update: function() {
204 this.positionKnob(this.calcRatio(this.value)); 212 this.positionKnob(this.calcRatio(this.value));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 }, 305 },
298 306
299 bardown: function(e) { 307 bardown: function(e) {
300 e.preventDefault(); 308 e.preventDefault();
301 this.transiting = true; 309 this.transiting = true;
302 this._w = this.$.sliderBar.offsetWidth; 310 this._w = this.$.sliderBar.offsetWidth;
303 var rect = this.$.sliderBar.getBoundingClientRect(); 311 var rect = this.$.sliderBar.getBoundingClientRect();
304 var ratio = (e.x - rect.left) / this._w; 312 var ratio = (e.x - rect.left) / this._w;
305 this.positionKnob(ratio); 313 this.positionKnob(ratio);
306 this.expandJob = this.job(this.expandJob, this.expandKnob, 60); 314 this.expandJob = this.job(this.expandJob, this.expandKnob, 60);
307 this.fire('change'); 315 this.asyncFire('change');
308 }, 316 },
309 317
310 knobTransitionEnd: function(e) { 318 knobTransitionEnd: function(e) {
311 if (e.target === this.$.sliderKnob) { 319 if (e.target === this.$.sliderKnob) {
312 this.transiting = false; 320 this.transiting = false;
313 } 321 }
314 }, 322 },
315 323
316 updateMarkers: function() { 324 updateMarkers: function() {
317 this.markers = []; 325 this.markers = [];
318 var l = (this.max - this.min) / this.step; 326 var l = (this.max - this.min) / this.step;
319 if (!this.snaps && l > this.maxMarkers) { 327 if (!this.snaps && l > this.maxMarkers) {
320 return; 328 return;
321 } 329 }
322 for (var i = 0; i < l; i++) { 330 for (var i = 0; i < l; i++) {
323 this.markers.push(''); 331 this.markers.push('');
324 } 332 }
325 }, 333 },
326 334
335 /**
336 * Increases value by `step` but not above `max`.
337 * @method increment
338 */
327 increment: function() { 339 increment: function() {
328 this.value = this.clampValue(this.value + this.step); 340 this.value = this.clampValue(this.value + this.step);
329 }, 341 },
330 342
343 /**
344 * Decreases value by `step` but not below `min`.
345 * @method decrement
346 */
331 decrement: function() { 347 decrement: function() {
332 this.value = this.clampValue(this.value - this.step); 348 this.value = this.clampValue(this.value - this.step);
333 }, 349 },
334 350
335 incrementKey: function(ev, keys) { 351 incrementKey: function(ev, keys) {
336 if (keys.key === "end") { 352 if (keys.key === "end") {
337 this.value = this.max; 353 this.value = this.max;
338 } else { 354 } else {
339 this.increment(); 355 this.increment();
340 } 356 }
341 this.fire('change'); 357 this.fire('change');
342 }, 358 },
343 359
344 decrementKey: function(ev, keys) { 360 decrementKey: function(ev, keys) {
345 if (keys.key === "home") { 361 if (keys.key === "home") {
346 this.value = this.min; 362 this.value = this.min;
347 } else { 363 } else {
348 this.decrement(); 364 this.decrement();
349 } 365 }
350 this.fire('change'); 366 this.fire('change');
351 } 367 }
352 368
353 }); 369 });
354 370
355 </script> 371 </script>
356 </polymer-element> 372 </polymer-element>
OLDNEW
« no previous file with comments | « polymer_0.5.4/bower_components/paper-slider/paper-slider.css ('k') | polymer_0.5.4/bower_components/paper-spinner/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698