OLD | NEW |
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 --padding-start-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 overflow: hidden; |
29 text-overflow: ellipsis; | 30 text-overflow: ellipsis; |
30 white-space: nowrap; | 31 white-space: nowrap; |
31 } | 32 } |
32 | 33 |
33 #container { | 34 #container { |
| 35 -webkit-padding-start: |
| 36 calc(var(--node-depth, 0) * var(--padding-start-per-depth)); |
| 37 cursor: pointer; |
34 height: 40px; | 38 height: 40px; |
35 padding-left: calc(var(--node-depth, 0) * 30px); | |
36 } | 39 } |
37 | 40 |
38 #folder-label { | 41 #folder-label { |
| 42 -webkit-padding-end: 8px; |
39 color: var(--secondary-text-color); | 43 color: var(--secondary-text-color); |
40 cursor: pointer; | |
41 flex-grow: 1; | 44 flex-grow: 1; |
42 overflow: hidden; | 45 overflow: hidden; |
43 } | 46 } |
44 | 47 |
45 :host([is-selected-folder_]) .menu-label, | 48 :host([is-selected-folder_]) .menu-label, |
46 :host([is-selected-folder_]) #folder-label { | 49 :host([is-selected-folder_]) #folder-label { |
47 color: var(--folder-active-color); | 50 color: var(--folder-active-color); |
48 } | 51 } |
49 | 52 |
50 iron-icon { | 53 iron-icon { |
51 --iron-icon-height: 20px; | 54 --iron-icon-height: 20px; |
52 --iron-icon-width: 20px; | 55 --iron-icon-width: 20px; |
53 min-width: 20px; | 56 min-width: 20px; |
54 } | 57 } |
55 | 58 |
56 paper-icon-button { | 59 #arrow { |
57 color: var(--secondary-text-color); | 60 color: var(--secondary-text-color); |
58 height: 36px; | 61 height: 36px; |
| 62 margin: 0 8px; |
59 min-width: 36px; | 63 min-width: 36px; |
60 padding: 8px; | 64 transform: rotate(-90deg); |
| 65 transition: transform 150ms; |
61 width: 36px; | 66 width: 36px; |
62 } | 67 } |
| 68 |
| 69 :host-context([dir='rtl']) #arrow { |
| 70 transform: rotate(90deg); |
| 71 } |
| 72 |
| 73 #arrow[is-open] { |
| 74 transform: initial; |
| 75 } |
| 76 |
| 77 [no-children] { |
| 78 -webkit-padding-start: 52px; /* The width of the arrow and its margin */ |
| 79 } |
63 </style> | 80 </style> |
64 | 81 |
65 <div id="container" class="v-centered"> | 82 <div id="container" class="v-centered" on-tap="selectFolder_"> |
66 <div id="folder-label" class="v-centered" on-tap="selectFolder_"> | 83 <template is="dom-if" if="[[hasChildFolder_(item_.children)]]"> |
67 <iron-icon icon="[[getFolderIcon_(isSelectedFolder_)]]"></iron-icon> | 84 <paper-icon-button id="arrow" icon="cr:arrow-drop-down" |
| 85 is-open$="[[!isClosed_]]" on-tap="toggleFolder_"> |
| 86 </paper-icon-button> |
| 87 </template> |
| 88 <div id="folder-label" class="v-centered"> |
| 89 <iron-icon icon="[[getFolderIcon_(isSelectedFolder_)]]" |
| 90 no-children$="[[!hasChildFolder_(item_.children)]]"> |
| 91 </iron-icon> |
68 <div class="menu-label">[[item_.title]]</div> | 92 <div class="menu-label">[[item_.title]]</div> |
69 </div> | 93 </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> | 94 </div> |
75 <div id="descendants" hidden$="[[isClosed_]]"> | 95 <div id="descendants" hidden$="[[isClosed_]]"> |
76 <template is="dom-repeat" | 96 <template is="dom-repeat" |
77 items="[[item_.children]]" | 97 items="[[item_.children]]" |
78 as="child" | 98 as="child" |
79 filter="isFolder_"> | 99 filter="isFolder_"> |
80 <bookmarks-folder-node item-id="[[child]]" | 100 <bookmarks-folder-node item-id="[[child]]" |
81 depth="[[getChildDepth_(depth)]]"> | 101 depth="[[getChildDepth_(depth)]]"> |
82 </bookmarks-folder-node> | 102 </bookmarks-folder-node> |
83 </template> | 103 </template> |
84 </div> | 104 </div> |
85 </template> | 105 </template> |
86 <script src="chrome://bookmarks/folder_node.js"></script> | 106 <script src="chrome://bookmarks/folder_node.js"></script> |
87 </dom-module> | 107 </dom-module> |
OLD | NEW |