Render an icon for toggle button

This commit is contained in:
Jeremy Dormitzer 2018-01-12 17:14:57 -05:00
parent 08b647b4f8
commit 93ed84cf69
No known key found for this signature in database
GPG Key ID: 04F17C0F5A32C320
3 changed files with 18 additions and 3 deletions

View File

@ -0,0 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="context-fill" d="M8 12a1 1 0 0 1-.707-.293l-5-5a1 1 0 0 1 1.414-1.414L8 9.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-5 5A1 1 0 0 1 8 12z"></path>
</svg>

After

Width:  |  Height:  |  Size: 459 B

View File

@ -0,0 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="context-fill" d="M13 11a1 1 0 0 1-.707-.293L8 6.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l5-5a1 1 0 0 1 1.414 0l5 5A1 1 0 0 1 13 11z"></path>
</svg>

After

Width:  |  Height:  |  Size: 456 B

View File

@ -20,13 +20,16 @@
author)
$card (dom/createDom "div" #js {:class "card"} $text $author)]
(if (> (count children) 0)
(let [$toggle (dom/createDom "div"
#js {:class "commentToggle"}
"<Toggle children>")
(let [$toggle (dom/createDom "img"
#js {:class "commentToggle"
:src "icons/arrowhead-down-16.svg"
:width "16px"
:height "16px"})
$children (apply dom/createDom
"div"
#js {:class "commentChildren"}
(clj->js (map comment-dom children)))]
(log $toggle)
(Zippy. $toggle $children)
(dom/appendChild $card $toggle)
(dom/createDom "div"