Skip to content

Commit

Permalink
Merge pull request #575 from codeforamerica/default-hide-geolcation
Browse files Browse the repository at this point in the history
Default hide geolcation
  • Loading branch information
anselmbradford committed Sep 4, 2014
2 parents 981689f + 3190908 commit 723577d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function (geo, alert) {
// If geolocation is supported, show geolocate button.
if (navigator.geolocation) {
_locateTarget = document.getElementById(target);
_locateTarget.classList.remove('hide');
_locateTargetTextContainer = _locateTarget.querySelector('span');
_locateAction = locateAction;

Expand Down
15 changes: 11 additions & 4 deletions app/assets/stylesheets/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -801,15 +801,22 @@ body { top: 0px !important; }
}

#geolocate-box
{
text-align: right;
}
.home #geolocate-box
{
position: absolute;
right: 0;
}

.inside #geolocate-box
{
right: 10px;
top: 9px;
// Fixed max-height and overflow adjustment needed to
// handle a 1-pixel layout difference between Chrome and Firefox.
@include box-sizing(border-box);
max-height: 23px;
overflow: hidden;
}

#search-options
{
font-family: $font_san_serif;
Expand Down
11 changes: 7 additions & 4 deletions app/assets/stylesheets/components/_input-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,22 @@
{
> .filter-input-group > input
{
@include rounded-except(lower-right);
@include rounded-except(upper-right);
}

.input-search-filter-option
{
top: -1px;
font-size: $font_size_95;
border: none;
margin: 0;
padding: 3px;
padding-top: 0;
padding-bottom: 0;
max-height: 23px;
background: rgba($white, 0.3);
border: 1px solid rgba($white, 0);
cursor: pointer;
@include rounded-except(top);
@include rounded-except(bottom);

>span
{
Expand All @@ -260,7 +263,7 @@
{
background: $search-button-hover-background;
border: 1px solid rgba($input-border-color,0.2);
border-top: 1px solid rgba($white, 0.3);
border-bottom: 1px solid rgba($white, 0.3);

.fa
{
Expand Down
2 changes: 1 addition & 1 deletion app/views/component/search/_geolocate.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#geolocate-box
= button_tag(type: 'submit', name: nil, id: 'button-geolocate', class: "button-small #{context_class}", data: { wait_text: t('buttons.during_geolocation'), regular_text: t('buttons.services_near_me') }) do
= button_tag(type: 'submit', name: nil, id: 'button-geolocate', class: "button-small #{context_class} hide", data: { wait_text: t('buttons.during_geolocation'), regular_text: t('buttons.services_near_me') }) do
%i{ class: 'fa fa-globe' }
%span= t('buttons.services_near_me')

0 comments on commit 723577d

Please sign in to comment.