OLD | NEW |
---|---|
1 <link rel="import" href="chrome://resources/html/assert.html"> | 1 <link rel="import" href="chrome://resources/html/assert.html"> |
2 <link rel="import" href="chrome://resources/html/polymer.html"> | 2 <link rel="import" href="chrome://resources/html/polymer.html"> |
3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> |
4 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_be havior.html"> | 4 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_be havior.html"> |
5 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_in dicator.html"> | 5 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_in dicator.html"> |
6 <link rel="import" href="pref_control_behavior.html"> | 6 <link rel="import" href="pref_control_behavior.html"> |
7 <link rel="import" href="../i18n_setup.html"> | 7 <link rel="import" href="../i18n_setup.html"> |
8 <link rel="import" href="../settings_shared_css.html"> | 8 <link rel="import" href="../settings_shared_css.html"> |
9 | 9 |
10 <dom-module id="controlled-button"> | 10 <dom-module id="controlled-button"> |
11 <template> | 11 <template> |
12 <style include="settings-shared"> | 12 <style include="settings-shared"> |
13 :host { | 13 :host { |
14 align-items: center; | 14 align-items: center; |
15 display: flex; | 15 display: flex; |
16 --justify-margin: 18px; | 16 margin-left: var(--secondary-action-button-margin); |
17 margin-right: var(--secondary-action-button-margin); | |
17 } | 18 } |
18 | 19 |
19 :host([enforced_]) { | 20 :host([enforced_]) { |
20 /* Disable pointer events for this whole element, as outer on-tap gets | 21 /* Disable pointer events for this whole element, as outer on-tap gets |
21 * triggered when clicking/tapping anywhere in :host. */ | 22 * triggered when clicking/tapping anywhere in :host. */ |
22 pointer-events: none; | 23 pointer-events: none; |
23 } | 24 } |
24 | 25 |
25 cr-policy-pref-indicator { | 26 cr-policy-pref-indicator { |
26 /* Enable pointer events for the indicator so :hover works. Disable | 27 /* Enable pointer events for the indicator so :hover works. Disable |
27 * clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */ | 28 * clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */ |
28 pointer-events: all; | 29 pointer-events: all; |
29 } | 30 } |
30 | 31 |
31 :host(:not([end-justified])) cr-policy-pref-indicator { | 32 :host(:not([end-justified])) cr-policy-pref-indicator { |
32 -webkit-margin-start: var(--justify-margin); | 33 -webkit-margin-end: calc( |
34 var(--cr-control-spacing) - var(--secondary-action-button-margin)); | |
35 -webkit-margin-start: var(--cr-control-spacing); | |
33 } | 36 } |
34 | 37 |
35 :host([end-justified]) cr-policy-pref-indicator { | 38 :host([end-justified]) cr-policy-pref-indicator { |
36 -webkit-margin-end: var(--justify-margin); | 39 -webkit-margin-end: var(--cr-control-spacing); |
40 -webkit-margin-start:calc( | |
Dan Beam
2017/04/26 20:48:29
nit: space after :
| |
41 var(--cr-control-spacing) - var(--secondary-action-button-margin)); | |
37 order: -1; | 42 order: -1; |
38 } | 43 } |
39 </style> | 44 </style> |
40 | 45 |
41 <paper-button disabled="[[enforced_]]">[[label]]</paper-button> | 46 <paper-button disabled="[[enforced_]]">[[label]]</paper-button> |
42 | 47 |
43 <template is="dom-if" if="[[hasPrefPolicyIndicator(pref.*)]]" restamp> | 48 <template is="dom-if" if="[[hasPrefPolicyIndicator(pref.*)]]" restamp> |
44 <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_" | 49 <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_" |
45 icon-aria-label="[[label]]"> | 50 icon-aria-label="[[label]]"> |
46 </cr-policy-pref-indicator> | 51 </cr-policy-pref-indicator> |
47 </template> | 52 </template> |
48 | 53 |
49 </template> | 54 </template> |
50 <script src="controlled_button.js"></script> | 55 <script src="controlled_button.js"></script> |
51 </dom-module> | 56 </dom-module> |
OLD | NEW |