OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Polymer({ | 5 Polymer({ |
6 is: 'controlled-button', | 6 is: 'controlled-button', |
7 | 7 |
8 behaviors: [CrPolicyPrefBehavior, PrefControlBehavior], | 8 behaviors: [CrPolicyPrefBehavior, PrefControlBehavior], |
9 | 9 |
10 properties: { | 10 properties: { |
| 11 endJustified: { |
| 12 type: Boolean, |
| 13 value: false, |
| 14 reflectToAttribute: true, |
| 15 }, |
| 16 |
11 /** @private */ | 17 /** @private */ |
12 controlled_: { | 18 controlled_: { |
13 type: Boolean, | 19 type: Boolean, |
14 computed: 'computeControlled_(pref.*)', | 20 computed: 'computeControlled_(pref.*)', |
15 reflectToAttribute: true, | 21 reflectToAttribute: true, |
16 }, | 22 }, |
17 }, | 23 }, |
18 | 24 |
19 /** | 25 /** |
20 * @return {boolean} Whether the button is disabled. | 26 * @return {boolean} Whether the button is disabled. |
21 * @private | 27 * @private |
22 */ | 28 */ |
23 computeControlled_: function() { | 29 computeControlled_: function() { |
24 return this.pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED; | 30 return this.pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED; |
25 }, | 31 }, |
26 | 32 |
27 /** | 33 /** |
28 * @param {!Event} e | 34 * @param {!Event} e |
29 * @private | 35 * @private |
30 */ | 36 */ |
31 onIndicatorTap_: function(e) { | 37 onIndicatorTap_: function(e) { |
32 // Disallow <controlled-button on-tap="..."> when controlled. | 38 // Disallow <controlled-button on-tap="..."> when controlled. |
33 e.preventDefault(); | 39 e.preventDefault(); |
34 e.stopPropagation(); | 40 e.stopPropagation(); |
35 }, | 41 }, |
36 }); | 42 }); |
OLD | NEW |