Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

Commit

Permalink
restructure markup so that search bar isn't covering download button
Browse files Browse the repository at this point in the history
  • Loading branch information
gemfarmer committed Mar 11, 2016
1 parent 4f8207d commit 58d8b9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 7 additions & 7 deletions forecast-admin/forecast/opportunities/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
{% block content %}

<div id="results">
<form class="usa-search usa-search-big">
<section class="usa-grid-full">
<div class="button-download_wrapper usa-width-one-fourth">

<a href="api/opportunities/?format=csv">
<button class="usa-button-outline button-download">
<button class="usa-button usa-button-outline button-download"
style="-webkit-appearance: button">
<icon class="button-download_icon fa fa-download"></icon>
<span class="button-download_text">Download as spreadsheet</span>
</button>
</a>
</div>

<div role="search" class="usa-width-three-fourths search-wrapper">
<form role="search" class="usa-search usa-search-big usa-width-three-fourths search-wrapper">
<label for="search" class="usa-sr-only" for="search-field-big">Search opportunities</label>
<input class="search" id="search-field-big" type="search" name="search" placeholder="Enter keyword">
<button type="button" id="filter-button" class="usa-search usa-search-submit " data-sort="description naics">
<span class="usa-search-submit-text">Search</span>
</button>

</div>
</form>
</form>
</section>


<div class="usa-grid grid-inner">

<drawer class="usa-width-one-fourth drawer" aria-hidden="true">

<button class="fa fa-close" data-drawer-toggle="close"></button>

{% include 'includes/filters.html' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ button,

// Custom
.button-download {
@extend button;

border-radius: 0;
display: table-row;
margin: 0;
Expand Down
9 changes: 4 additions & 5 deletions forecast-admin/forecast/static/assets/js/src/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ $(document).ready(function() {
_.each(_.keys(queries), function(key) {
urlQuery += "&"+key+"="+queries[key];
});
$(".button-download_wrapper>a").attr("href",urlStem+urlQuery);
$(".button-download_wrapper a").attr("href",urlStem+urlQuery);
listObj.filter(function(item) {
return (filterCheck(item, queries));
});
Expand All @@ -155,7 +155,6 @@ $(document).ready(function() {

// Search within list of opportunities
$(".search").keyup(function () {
console.log('hello');
urlQuery = "";
if ($(this).val().length > 0) {
queries.description = $(this).val();
Expand All @@ -165,7 +164,7 @@ $(document).ready(function() {
_.each(_.keys(queries), function(key) {
urlQuery += "&"+key+"="+queries[key];
});
$(".button-download_wrapper>a").attr("href",urlStem+urlQuery);
$(".button-download_wrapper a").attr("href",urlStem+urlQuery);
listObj.filter(function(item) {
return (filterCheck(item, queries));
});
Expand Down Expand Up @@ -196,7 +195,7 @@ $(document).ready(function() {
_.each(_.keys(queries), function(key) {
urlQuery += "&"+key+"="+queries[key];
});
$(".button-download_wrapper>a").attr("href",urlStem+urlQuery);
$(".button-download_wrapper a").attr("href",urlStem+urlQuery);
listObj.filter(function(item) {
return (filterCheck(item, queries));
});
Expand All @@ -210,7 +209,7 @@ $(document).ready(function() {
_.each(_.keys(queries), function(key) {
urlQuery += "&"+key+"="+queries[key];
});
$(".button-download_wrapper>a").attr("href",urlStem+urlQuery);
$(".button-download_wrapper a").attr("href",urlStem+urlQuery);
listObj.filter(function(item) {
return (filterCheck(item, queries));
});
Expand Down

0 comments on commit 58d8b9b

Please sign in to comment.