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

Side by Side Diff: chrome/browser/resources/settings/controls/controlled_button.html

Issue 2611243002: MD Settings: fix policy indicator rendering bug in <controlled-button> (Closed)
Patch Set: . Created 3 years, 11 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 <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_indicat or_behavior.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_be havior.html">
5 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_in dicator.html"> 6 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_in dicator.html">
6 <link rel="import" href="/controls/pref_control_behavior.html"> 7 <link rel="import" href="/controls/pref_control_behavior.html">
8 <link rel="import" href="/i18n_setup.html">
7 <link rel="import" href="/settings_shared_css.html"> 9 <link rel="import" href="/settings_shared_css.html">
8 10
9 <dom-module id="controlled-button"> 11 <dom-module id="controlled-button">
10 <template> 12 <template>
11 <style include="settings-shared"> 13 <style include="settings-shared">
12 :host { 14 :host {
13 align-items: center; 15 align-items: center;
14 display: flex; 16 display: flex;
15 } 17 }
16 18
17 :host([controlled_]) { 19 :host([controlled_]) {
18 /* Disable pointer events for this whole element, as outer on-tap gets 20 /* Disable pointer events for this whole element, as outer on-tap gets
19 * triggered when clicking/tapping anywhere in :host. */ 21 * triggered when clicking/tapping anywhere in :host. */
20 pointer-events: none; 22 pointer-events: none;
21 } 23 }
22 24
23 cr-policy-pref-indicator { 25 cr-policy-pref-indicator {
24 -webkit-margin-start: var(--checkbox-spacing); 26 -webkit-margin-start: var(--checkbox-spacing);
25 /* Enable pointer events for the indicator so :hover works. Disable 27 /* Enable pointer events for the indicator so :hover works. Disable
26 * clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */ 28 * clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */
27 pointer-events: all; 29 pointer-events: all;
28 } 30 }
29 </style> 31 </style>
30 32
31 <paper-button disabled="[[controlled_]]"> 33 <paper-button disabled="[[controlled_]]">
32 <content></content> 34 <content></content>
33 </paper-button> 35 </paper-button>
34 36
35 <template is="dom-if" if="[[controlled_]]"> 37 <template is="dom-if" if="[[showIndicator_(pref)]]" restamp>
36 <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_"> 38 <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_">
37 </cr-policy-pref-indicator> 39 </cr-policy-pref-indicator>
38 </template> 40 </template>
39 41
40 </template> 42 </template>
41 <script src="/controls/controlled_button.js"></script> 43 <script src="/controls/controlled_button.js"></script>
42 </dom-module> 44 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698