Skip to content

Commit

Permalink
Merge pull request #110 from srowhani/feature/perf
Browse files Browse the repository at this point in the history
Performance
  • Loading branch information
sglanzer committed Feb 21, 2017
2 parents 0bb7498 + d2ef900 commit b07a972
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
28 changes: 7 additions & 21 deletions addon/styles/_frost-list-item-container.scss
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
.frost-list-item-container {
padding: 0 1px 1px;
border-top: 1px solid $frost-color-lgrey-1;
margin: 1px;
outline: 1px solid $frost-color-lgrey-1;

&:hover {
& .frost-list-item-container-base,
& .frost-list-item-container-expansion {
.frost-list-item-container-base,
.frost-list-item-container-expansion {
background-color: $frost-list-item-hover-color;
cursor: pointer;
}
}

&.is-selected {
padding: 0;
border-right: 1px solid $frost-color-blue-1;
border-bottom: 1px solid $frost-color-blue-1;
border-left: 1px solid $frost-color-blue-1;

&.is-lead-selection {
border-top: 1px solid $frost-color-blue-1;
}
position: relative;
outline: 1px solid $frost-color-blue-1;
z-index: 1;
}

&.first {
padding-top: 1px;
border-top: 0;

&.is-selected {
padding-top: 0;
border-top: 1px solid $frost-color-blue-1;
}
}

// The last list item container is given a class so that it can be targeted
// This is primarily to support the case where additional bottom margin needs
Expand Down
4 changes: 4 additions & 0 deletions addon/templates/components/frost-list-content-container.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
}}
{{#each items as |model index|}}
{{yield model index}}
{{else}}
{{yield to="inverse"}}
{{/each}}
{{/frost-scroll}}
{{else}}
Expand Down Expand Up @@ -36,5 +38,7 @@
as |model index|
}}
{{yield model index}}
{{else}}
{{yield to="inverse"}}
{{/vertical-collection}}
{{/if}}
5 changes: 3 additions & 2 deletions addon/templates/components/frost-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
frost-list-item-container
{{if (eq index 0) ' first'}}
{{if (eq index (sub _items.length 1)) ' last'}}
{{if model.isSelected ' is-selected'}}
{{if (is-lead-selection _items model) ' is-lead-selection'}}'
{{if model.isSelected ' is-selected'}}'
data-test={{hook (concat hook '-item-container') index=index }}
>
<div class='frost-list-item-container-base'>
Expand Down Expand Up @@ -87,5 +86,7 @@
</div>
{{/if}}
</div>
{{else}}
{{yield to="inverse"}}
{{/frost-list-content-container}}
<div class='frost-list-content-container-bottom-border {{if pagination 'paged'}}'></div>

0 comments on commit b07a972

Please sign in to comment.