| Index: third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
|
| diff --git a/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html b/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
|
| index f2efb7c5586b0226418cfefabf05abc416320ed0..33e42ea1091e58d85ec58f8fb6608467796faf52 100644
|
| --- a/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
|
| +++ b/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
|
| @@ -12,18 +12,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
| <script>
|
|
|
| - /** @polymerBehavior */
|
| -
|
| + /**
|
| + * @demo demo/index.html
|
| + * @polymerBehavior
|
| + */
|
| Polymer.IronControlState = {
|
|
|
| properties: {
|
|
|
| /**
|
| * If true, the element currently has focus.
|
| - *
|
| - * @attribute focused
|
| - * @type boolean
|
| - * @default false
|
| */
|
| focused: {
|
| type: Boolean,
|
| @@ -35,10 +33,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
| /**
|
| * If true, the user cannot interact with this element.
|
| - *
|
| - * @attribute disabled
|
| - * @type boolean
|
| - * @default false
|
| */
|
| disabled: {
|
| type: Boolean,
|
| @@ -50,32 +44,44 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
| _oldTabIndex: {
|
| type: Number
|
| + },
|
| +
|
| + _boundFocusBlurHandler: {
|
| + type: Function,
|
| + value: function() {
|
| + return this._focusBlurHandler.bind(this);
|
| + }
|
| }
|
| +
|
| },
|
|
|
| observers: [
|
| '_changedControlState(focused, disabled)'
|
| ],
|
|
|
| - listeners: {
|
| - focus: '_focusHandler',
|
| - blur: '_blurHandler'
|
| - },
|
| -
|
| ready: function() {
|
| // TODO(sjmiles): ensure read-only property is valued so the compound
|
| // observer will fire
|
| if (this.focused === undefined) {
|
| this._setFocused(false);
|
| }
|
| + this.addEventListener('focus', this._boundFocusBlurHandler, true);
|
| + this.addEventListener('blur', this._boundFocusBlurHandler, true);
|
| },
|
|
|
| - _focusHandler: function() {
|
| - this._setFocused(true);
|
| - },
|
| -
|
| - _blurHandler: function() {
|
| - this._setFocused(false);
|
| + _focusBlurHandler: function(event) {
|
| + var target = event.path ? event.path[0] : event.target;
|
| + if (target === this) {
|
| + var focused = event.type === 'focus';
|
| + this._setFocused(focused);
|
| + } else if (!this.shadowRoot) {
|
| + event.stopPropagation();
|
| + this.fire(event.type, {sourceEvent: event}, {
|
| + node: this,
|
| + bubbles: event.bubbles,
|
| + cancelable: event.cancelable
|
| + });
|
| + }
|
| },
|
|
|
| _disabledChanged: function(disabled, old) {
|
|
|