Commit 86601ec6 authored by Dave Schuyler's avatar Dave Schuyler Committed by Commit Bot

[MD settings] Make expand row clickable

This CL makes the cookie name part of the expand button so that clicking
on it will expand/collapse the local data.

Bug: 752821
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id81f16c3ecd435c4e99e4ccd9a6cfacf0cf81ef8
Reviewed-on: https://chromium-review.googlesource.com/820651Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Dave Schuyler <dschuyler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524252}
parent 14192230
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
</style> </style>
<template is="dom-repeat" items="[[entries_]]"> <template is="dom-repeat" items="[[entries_]]">
<div class="settings-box" first$="[[!index]]"> <div class="settings-box" first$="[[!index]]">
<div class="start">[[getEntryDescription_(item)]]</div> <cr-expand-button class="start" expanded="{{item.expanded_}}">
<cr-expand-button expanded="{{item.expanded_}}"> [[getEntryDescription_(item)]]
</cr-expand-button> </cr-expand-button>
<div class="separator"></div> <div class="separator"></div>
<button is="paper-icon-button-light" data-id-path$="[[item.idPath]]" <button is="paper-icon-button-light" data-id-path$="[[item.idPath]]"
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
<dom-module id="cr-expand-button"> <dom-module id="cr-expand-button">
<template> <template>
<style include="cr-icons cr-shared-style"> <style include="cr-icons cr-shared-style">
:host {
display: inline-block;
}
:host([disabled]) { :host([disabled]) {
pointer-events: none; pointer-events: none;
} }
...@@ -17,13 +13,24 @@ ...@@ -17,13 +13,24 @@
button[is=paper-icon-button-light] { button[is=paper-icon-button-light] {
@apply(--cr-paper-icon-button-margin); @apply(--cr-paper-icon-button-margin);
} }
#outer {
align-items: center;
display: flex;
}
#label {
flex: 1;
}
</style> </style>
<content></content> <div id="outer" on-tap="toggleExpand_">
<button is="paper-icon-button-light" class$="[[iconName_(expanded)]]" <div id="label" on-tap="toggleExpand_"><slot></slot></div>
toggles active="{{expanded}}" disabled="[[disabled]]" alt="[[alt]]" <button is="paper-icon-button-light" class$="[[iconName_(expanded)]]"
aria-active-attribute="aria-expanded" on-tap="toggleExpand_" toggles active="{{expanded}}" disabled="[[disabled]]" alt="[[alt]]"
tabindex$="[[tabIndex]]"> aria-active-attribute="aria-expanded"
</button> tabindex$="[[tabIndex]]">
</button>
</div>
</template> </template>
<script src="cr_expand_button.js"></script> <script src="cr_expand_button.js"></script>
</dom-module> </dom-module>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment