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 --margin-left-per-depth: 36px; | |
16 cursor: pointer; | |
15 display: block; | 17 display: block; |
16 } | 18 } |
17 | 19 |
18 .v-centered { | 20 .v-centered { |
19 align-items: center; | 21 align-items: center; |
20 display: flex; | 22 display: flex; |
21 flex-direction: row; | 23 flex-direction: row; |
22 } | 24 } |
23 | 25 |
24 .menu-label { | 26 .menu-label { |
25 -webkit-margin-start: 24px; | 27 -webkit-margin-start: 16px; |
26 color: var(--folder-inactive-color); | 28 color: var(--folder-inactive-color); |
27 font-weight: 500; | 29 font-weight: 500; |
28 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 { |
34 height: 40px; | 35 height: 40px; |
35 padding-left: calc(var(--node-depth, 0) * 30px); | 36 padding-left: calc(var(--node-depth, 0) * var(--margin-left-per-depth)); |
tsergeant
2017/03/14 03:38:51
Oops, didn't think about this last patch:
All the
calamity
2017/03/14 07:07:55
Done.
| |
36 } | 37 } |
37 | 38 |
38 #folder-label { | 39 #folder-label { |
39 color: var(--secondary-text-color); | 40 color: var(--secondary-text-color); |
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); |
tsergeant
2017/03/14 03:38:51
You can make this look fancy pretty easily:
trans
calamity
2017/03/14 07:07:55
So delightful. Wow.
| |
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; | |
tsergeant
2017/03/14 03:38:51
Can you put a comment in explaining where the magi
calamity
2017/03/14 07:07:55
Done.
| |
71 } | |
63 </style> | 72 </style> |
64 | 73 |
65 <div id="container" class="v-centered"> | 74 <div id="container" class="v-centered" on-tap="selectFolder_"`> |
tsergeant
2017/03/14 03:38:51
There's a stray backtick at the end of the tag
calamity
2017/03/14 07:07:55
Oops.
| |
66 <div id="folder-label" class="v-centered" on-tap="selectFolder_"> | 75 <template is="dom-if" if="[[hasChildFolder_(item_.children)]]"> |
67 <iron-icon icon="[[getFolderIcon_(isSelectedFolder_)]]"></iron-icon> | 76 <paper-icon-button id="arrow" icon="cr:arrow-drop-down" |
77 is-open$="[[!isClosed_]]" on-tap="toggleFolder_"> | |
tsergeant
2017/03/14 03:38:51
When you click this button, it will also call sele
calamity
2017/03/14 07:07:55
Oh good catch. Done.
| |
78 </paper-icon-button> | |
79 </template> | |
80 <div id="folder-label" class="v-centered"> | |
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> |
OLD | NEW |