Skip to content

Fix #1454: Remove "Expand" button to improve usability. #1455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions _overviews/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ permalink: /overviews/:title.html
</div>
</div>
<div class="card-footer">
<div class="expand-btn"><i class="fa fa-plus" aria-hidden="true"></i> Expand</div>
<div class="go-btn" style="display: none;" href="{{ overview.url }}"><i class="fa fa-arrow-right" aria-hidden="true"></i> Read</div>
<a class="go-btn" href="{{ overview.url }}"><i class="fa fa-arrow-right" aria-hidden="true"></i> Read</a>
</div>
</div>
{% endfor %}
Expand Down
32 changes: 14 additions & 18 deletions _sass/layout/overviews.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@
position: relative;
flex: 0 1 calc(50% - 1em);
margin-bottom: 2em;
transition: max-height .3s ease-out;
text-decoration: none;
border-radius: 2px;
box-shadow: 0 1px 3px 0 rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 2px 1px -1px rgba(0,0,0,.12);
background: #fff;
max-height: 400px;
overflow: hidden;

@include bp(medium) {
Expand All @@ -76,7 +74,7 @@
.card-content {
padding: 20px;
padding-top: 0px;
padding-bottom: 0px;
padding-bottom: 60px;
}

h2 {
Expand Down Expand Up @@ -160,25 +158,23 @@
position: absolute;
bottom: 0;
width: 100%;
padding: 20px;
height: 66px;
background: #fff;
border-top: 1px solid lighten($base-font-color-light, 35%);

&:hover {
cursor: pointer;
background: $brand-primary;
.expand-btn,
.go-btn {
color: #fff;
}
}

.expand-btn,
.go-btn {
color: lighten($base-font-color-light, 15%);
display: block;
padding: 20px;
height: 66px;
background: #fff;
border-top: 1px solid lighten($base-font-color-light, 35%);
color: lighten($base-font-color-light, 10%);
font-weight: $font-regular;
font-size: $font-regular;
text-decoration: none;

&:hover {
cursor: pointer;
background: $brand-primary;
color: #fff;
}
}
}
}
24 changes: 0 additions & 24 deletions resources/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,30 +133,6 @@ $(document).ready(function() {

return false;
};

$('.white-card').each(function(index) {
if (!$(this).hasOverflow()) {
$(this).find(".expand-btn").hide();
$(this).find(".go-btn").show();
}
});

$(".card-footer").click(function() {
// if we clicked on the expand button, expand the box
if ($(this).find(".expand-btn").is(':visible')) {

// height mangling becasue flexbox align-self: self-end; doesn't work :(
$(this).parent().css('max-height', 'none');
var cardWrapHeight = $(this).parent().find(".card-wrap").outerHeight();
var cardFooterHeight = $(this).outerHeight()
$(this).parent().outerHeight(cardWrapHeight + cardFooterHeight);

$(this).find(".expand-btn").hide();
$(this).find(".go-btn").show();
} else {
window.location.href = $(this).find(".go-btn").attr("href");
}
});
});


Expand Down