Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nummi committed Sep 19, 2019
1 parent 047e1eb commit 68a011f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
5 changes: 0 additions & 5 deletions app/helpers/do-if.js

This file was deleted.

3 changes: 1 addition & 2 deletions app/templates/components/deprecation-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<div class="flex items-center">
<div
class="flex items-center flex-grow py-2"
{{on "click" disclosure.toggle}}
>
{{#if @model.hasSourceMap}}
<div class="flex-shrink-0 w-3">
<Ui::DisclosureTriangle @expanded={{disclosure.isExpanded}} />
<disclosure.triangleIcon />
</div>
{{/if}}

Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/render-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
style=this.nameStyle
}}
{{#if this.hasChildren}}
<Ui::DisclosureTriangle @expanded={{disclosure.isExpanded}} />
<disclosure.triangleIcon />
{{/if}}

<span title={{@model.name}}>
Expand Down
23 changes: 16 additions & 7 deletions lib/ui/app/templates/components/ui/disclosure-triangle.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<button
class="disclosure-triangle {{if @expanded "expanded" "collapsed"}}"
{{on "click" (do-if @toggle @toggle)}}
...attributes
>
{{svg-jar "disclosure-triangle" width="9px" height="9px"}}
</button>
{{#if @toggle}}
<button
class="disclosure-triangle {{if @expanded "expanded" "collapsed"}}"
{{on "click" @toggle}}
...attributes
>
{{svg-jar "disclosure-triangle" width="9px" height="9px"}}
</button>
{{else}}
<span
class="disclosure-triangle {{if @expanded "expanded" "collapsed"}}"
...attributes
>
{{svg-jar "disclosure-triangle" width="9px" height="9px"}}
</span>
{{/if}}
2 changes: 2 additions & 0 deletions lib/ui/app/templates/components/ui/disclosure.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{yield (hash
isExpanded=this.isExpanded
toggle=this.toggle
triangleIcon=(component "ui/disclosure-triangle" expanded=this.isExpanded)
triangleButton=(component "ui/disclosure-triangle" expanded=this.isExpanded toggle=this.toggle)
)}}

0 comments on commit 68a011f

Please sign in to comment.