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

Side by Side Diff: chrome/browser/resources/md_bookmarks/folder_node.html

Issue 2745593004: [MD Bookmarks] Add draggable sidebar. (Closed)
Patch Set: Created 3 years, 9 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/polymer.html"> 1 <link rel="import" href="chrome://resources/html/polymer.html">
2 <link rel="import" href="chrome://resources/cr_elements/icons.html"> 2 <link rel="import" href="chrome://resources/cr_elements/icons.html">
3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> 3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l">
4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html "> 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html ">
6 <link rel="import" href="chrome://bookmarks/actions.html"> 6 <link rel="import" href="chrome://bookmarks/actions.html">
7 <link rel="import" href="chrome://bookmarks/icons.html"> 7 <link rel="import" href="chrome://bookmarks/icons.html">
8 <link rel="import" href="chrome://bookmarks/shared_style.html"> 8 <link rel="import" href="chrome://bookmarks/shared_style.html">
9 <link rel="import" href="chrome://bookmarks/store_client.html"> 9 <link rel="import" href="chrome://bookmarks/store_client.html">
10 10
11 <dom-module id="bookmarks-folder-node"> 11 <dom-module id="bookmarks-folder-node">
12 <template> 12 <template>
13 <style include="shared-style"> 13 <style include="shared-style">
14 :host { 14 :host {
15 --margin-left-per-depth: 36px;
15 display: block; 16 display: block;
16 } 17 }
17 18
18 .v-centered { 19 .v-centered {
19 align-items: center; 20 align-items: center;
20 display: flex; 21 display: flex;
21 flex-direction: row; 22 flex-direction: row;
22 } 23 }
23 24
24 .menu-label { 25 .menu-label {
25 -webkit-margin-start: 24px; 26 -webkit-margin-start: 16px;
26 color: var(--folder-inactive-color); 27 color: var(--folder-inactive-color);
27 font-weight: 500; 28 font-weight: 500;
28 overflow: hidden;
29 text-overflow: ellipsis; 29 text-overflow: ellipsis;
30 white-space: nowrap; 30 white-space: nowrap;
31 } 31 }
32 32
33 #container { 33 #container {
34 height: 40px; 34 height: 40px;
35 margin-left: calc(var(--node-depth, 0) * 30px); 35 margin-left: calc(var(--node-depth, 0) * var(--margin-left-per-depth));
36 } 36 }
37 37
38 #folder-label { 38 #folder-label {
39 color: var(--secondary-text-color); 39 color: var(--secondary-text-color);
40 cursor: pointer; 40 cursor: pointer;
41 flex-grow: 1; 41 flex-grow: 1;
42 overflow: hidden; 42 padding-right: 8px;
43 } 43 }
44 44
45 :host([is-selected-folder_]) .menu-label, 45 :host([is-selected-folder_]) .menu-label,
46 :host([is-selected-folder_]) #folder-label { 46 :host([is-selected-folder_]) #folder-label {
47 color: var(--folder-active-color); 47 color: var(--folder-active-color);
48 } 48 }
49 49
50 iron-icon { 50 iron-icon {
51 --iron-icon-height: 20px; 51 --iron-icon-height: 20px;
52 --iron-icon-width: 20px; 52 --iron-icon-width: 20px;
53 min-width: 20px; 53 min-width: 20px;
54 } 54 }
55 55
56 paper-icon-button { 56 #arrow {
57 color: var(--secondary-text-color); 57 color: var(--secondary-text-color);
58 height: 36px; 58 height: 36px;
59 margin: 0 8px;
59 min-width: 36px; 60 min-width: 36px;
60 padding: 8px; 61 transform: rotate(270deg);
61 width: 36px; 62 width: 36px;
62 } 63 }
64
65 #arrow[is-open] {
66 transform: initial;
67 }
68
69 [no-children] {
70 padding-left: 52px;
71 }
63 </style> 72 </style>
64 73
65 <div id="container" class="v-centered"> 74 <div id="container" class="v-centered">
75 <template is="dom-if" if="[[hasChildFolder_(item_.children)]]">
76 <paper-icon-button id="arrow" icon="cr:arrow-drop-down"
77 is-open$="[[!isClosed_]]" on-tap="toggleFolder_">
78 </paper-icon-button>
79 </template>
66 <div id="folder-label" class="v-centered" on-tap="selectFolder_"> 80 <div id="folder-label" class="v-centered" on-tap="selectFolder_">
67 <iron-icon icon="[[getFolderIcon_(isSelectedFolder_)]]"></iron-icon> 81 <iron-icon icon="[[getFolderIcon_(isSelectedFolder_)]]"
82 no-children$="[[!hasChildFolder_(item_.children)]]">
83 </iron-icon>
68 <div class="menu-label">[[item_.title]]</div> 84 <div class="menu-label">[[item_.title]]</div>
69 </div> 85 </div>
70 <template is="dom-if" if="[[hasChildFolder_(item_.children)]]">
71 <paper-icon-button icon="[[getArrowIcon_(isClosed_)]]"
72 on-tap="toggleFolder_"></paper-icon-button>
73 </template>
74 </div> 86 </div>
75 <div id="descendants" hidden$="[[isClosed]]"> 87 <div id="descendants" hidden$="[[isClosed_]]">
76 <template is="dom-repeat" 88 <template is="dom-repeat"
77 items="[[item_.children]]" 89 items="[[item_.children]]"
78 as="child" 90 as="child"
79 filter="isFolder_"> 91 filter="isFolder_">
80 <bookmarks-folder-node item-id="[[child]]" 92 <bookmarks-folder-node item-id="[[child]]"
81 depth="[[getChildDepth_(depth)]]"> 93 depth="[[getChildDepth_(depth)]]">
82 </bookmarks-folder-node> 94 </bookmarks-folder-node>
83 </template> 95 </template>
84 </div> 96 </div>
85 </template> 97 </template>
86 <script src="chrome://bookmarks/folder_node.js"></script> 98 <script src="chrome://bookmarks/folder_node.js"></script>
87 </dom-module> 99 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698