|
35 | 35 | * |
36 | 36 | * @mixinFunction |
37 | 37 | * @polymer |
| 38 | + * @appliesMixin Polymer.PropertiesChanged |
38 | 39 | * @memberof Polymer |
39 | 40 | */ |
40 | | - Polymer.DisableUpgradeMixin = (base) => { |
| 41 | + Polymer.DisableUpgradeMixin = Polymer.dedupingMixin((base) => { |
41 | 42 |
|
42 | | - return class DisableUpgradeClass extends base { |
| 43 | + /** |
| 44 | + * @constructor |
| 45 | + * @extends {base} |
| 46 | + * @implements {Polymer_PropertiesMixin} |
| 47 | + */ |
| 48 | + const superClass = Polymer.PropertiesMixin(base); |
| 49 | + /** |
| 50 | + * @polymer |
| 51 | + * @mixinClass |
| 52 | + * @implements {Polymer_DisableUpgradeMixin} |
| 53 | + */ |
| 54 | + class DisableUpgradeClass extends superClass { |
43 | 55 |
|
| 56 | + /** @override */ |
44 | 57 | static get observedAttributes() { |
45 | 58 | return super.observedAttributes.concat(DISABLED_ATTR); |
46 | 59 | } |
47 | 60 |
|
| 61 | + /** @override */ |
48 | 62 | attributeChangedCallback(name, old, value) { |
49 | 63 | if (name == DISABLED_ATTR) { |
50 | 64 | if (!this.__dataEnabled && value == null && this.isConnected) { |
|
60 | 74 | attributes are delivered. Therefore, we stub this out and |
61 | 75 | call `super._initializeProperties()` manually. |
62 | 76 | */ |
| 77 | + /** @override */ |
63 | 78 | _initializeProperties() {} |
64 | 79 |
|
65 | 80 | // prevent user code in connected from running |
| 81 | + /** @override */ |
66 | 82 | connectedCallback() { |
67 | 83 | if (this.__dataEnabled || !this.hasAttribute(DISABLED_ATTR)) { |
68 | 84 | super.connectedCallback(); |
69 | 85 | } |
70 | 86 | } |
71 | 87 |
|
72 | 88 | // prevent element from turning on properties |
| 89 | + /** @override */ |
73 | 90 | _enableProperties() { |
74 | 91 | if (!this.hasAttribute(DISABLED_ATTR)) { |
75 | 92 | if (!this.__dataEnabled) { |
|
80 | 97 | } |
81 | 98 |
|
82 | 99 | // only go if "enabled" |
| 100 | + /** @override */ |
83 | 101 | disconnectedCallback() { |
84 | 102 | if (this.__dataEnabled) { |
85 | 103 | super.disconnectedCallback(); |
86 | 104 | } |
87 | 105 | } |
88 | 106 |
|
89 | | - }; |
| 107 | + } |
90 | 108 |
|
91 | | - }; |
| 109 | + return DisableUpgradeClass; |
| 110 | + |
| 111 | + }); |
92 | 112 |
|
93 | 113 | })(); |
94 | 114 |
|
|
0 commit comments