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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js

Issue 1351623008: MD Settings: Languages model for language pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SingletonPrefs
Patch Set: Created 5 years, 3 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
3 /**
2 * Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-con tainer>`. This 4 * Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-con tainer>`. This
3 * behavior is implemented by `<paper-input>`. It exposes a number of properti es from 5 * behavior is implemented by `<paper-input>`. It exposes a number of properti es from
4 * `<paper-input-container>` and `<input is="iron-input">` and they should be bound in your 6 * `<paper-input-container>` and `<input is="iron-input">` and they should be bound in your
5 * template. 7 * template.
6 * 8 *
7 * The input element can be accessed by the `inputElement` property if you nee d to access 9 * The input element can be accessed by the `inputElement` property if you nee d to access
8 * properties or methods that are not exposed. 10 * properties or methods that are not exposed.
9 * @polymerBehavior Polymer.PaperInputBehavior 11 * @polymerBehavior Polymer.PaperInputBehavior
10 */ 12 */
11 Polymer.PaperInputBehaviorImpl = { 13 Polymer.PaperInputBehaviorImpl = {
12 14
13 properties: { 15 properties: {
16 /**
17 * Fired when the input changes due to user interaction.
18 *
19 * @event change
20 */
14 21
15 /** 22 /**
16 * The label for this input. Bind this to `<paper-input-container>`'s `lab el` property. 23 * The label for this input. Bind this to `<paper-input-container>`'s `lab el` property.
17 */ 24 */
18 label: { 25 label: {
19 type: String 26 type: String
20 }, 27 },
21 28
22 /** 29 /**
23 * The value for this input. Bind this to the `<input is="iron-input">`'s `bindValue` 30 * The value for this input. Bind this to the `<input is="iron-input">`'s `bindValue`
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 return; 381 return;
375 } 382 }
376 var labelledBy; 383 var labelledBy;
377 if (label.id) { 384 if (label.id) {
378 labelledBy = label.id; 385 labelledBy = label.id;
379 } else { 386 } else {
380 labelledBy = 'paper-input-label-' + new Date().getUTCMilliseconds(); 387 labelledBy = 'paper-input-label-' + new Date().getUTCMilliseconds();
381 label.id = labelledBy; 388 label.id = labelledBy;
382 } 389 }
383 this._ariaLabelledBy = labelledBy; 390 this._ariaLabelledBy = labelledBy;
391 },
392
393 _onChange:function(event) {
394 // In the Shadow DOM, the `change` event is not leaked into the
395 // ancestor tree, so we must do this manually.
396 // See https://w3c.github.io/webcomponents/spec/shadow/#events-that-are-no t-leaked-into-ancestor-trees.
397 if (this.shadowRoot) {
398 this.fire(event.type, {sourceEvent: event}, {
399 node: this,
400 bubbles: event.bubbles,
401 cancelable: event.cancelable
402 });
403 }
384 } 404 }
385 405
386 }; 406 };
387 407
388 /** @polymerBehavior */ 408 /** @polymerBehavior */
389 Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBeha viorImpl]; 409 Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBeha viorImpl];
410
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698