-
Notifications
You must be signed in to change notification settings - Fork 0
Ecosystem sort #37
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
Ecosystem sort #37
Conversation
assets/main.scss
Outdated
@@ -29,6 +28,7 @@ $baseurl:"{{ site.baseurl }}"; | |||
@import "cookie-banner"; | |||
@import "hub"; | |||
@import "hub-search"; | |||
@import "ecosystem"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you accidentally deleted the ecosystem file and then re-added it.
assets/ecosystem-sort.js
Outdated
var filterScript = $("script[src*=ecosystem-sort]"); | ||
var listId = filterScript.attr("list-id"); | ||
|
||
var ecosystemList =new List("ecosystem-index-cards", { | ||
valueNames: ['github-stars-count'] | ||
}); | ||
|
||
$("#sortLow").on("click", function() { | ||
ecosystemList.sort("github-stars-count", { order: "asc" }); | ||
}); | ||
|
||
$("#sortHigh").on("click", function() { | ||
ecosystemList.sort("github-stars-count", { order: "desc" }); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code probably isn't necessary since you already added the sort functionality to the github-stars branch. You should be able to add the sorting script by referencing the filter-hub-tags.js
script. Take a look at the bottom of hub.html
for an example. It might be sort of janky to test because the sorting code is on that other branch and not merged into site
yet, but you can just copy it and paste into your branch to test.
.ecosystem #dropdownSort, #dropdownSortLeft { | ||
margin-left: 0; | ||
} | ||
.ecosystem-filter-menu { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - Can you add a space above ecosystem-filter-menu
?
ecosystem/ecosystem.html
Outdated
<script star-count-call-date="ecosystemStarCountCallDate" star-count-data="ecosystemStarCountData" src="{{ site.baseurl }}/assets/github-stars.js"></script> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script> | ||
<script list-id="ecosystem-index-cards" display-count="100" pagination="false" src="{{ site.baseurl }}/assets/filter-hub-tags.js"></script> | ||
<script src="{{ site.baseurl }}/assets/hub-sort.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this hub-sort script since the sorting will be coming from filter-hub-tags.
_sass/ecosystem.scss
Outdated
.ecosystem, #dropdownSort, #dropdownSortLeft { | ||
margin-left: 0 !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to use !important
if you put #dropdownSort
and #dropdownSortLeft
within an ecosystem
block. Then those 2 IDs will only apply to the ecosystem page.
This commit adds sort to ecosystem
This commit adds sort to Ecosystem
This commit adds sort to Ecosystem
This PR adds functionality to sort Ecosystem cards by Github Stars Count