Skip to content
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

Default hide geolcation #575

Merged
merged 2 commits into from
Sep 4, 2014
Merged

Default hide geolcation #575

merged 2 commits into from
Sep 4, 2014

Conversation

anselmbradford
Copy link
Member

  • Geolocation button was showing up when geolocation was not supported
    (IE8). This hides the button by default and displays it only when
    geolocation is supported.
  • Removes unneeded ERB.
  • Fixes Move Services Near Me on filter above input field #503 - Moves geolocation button on inside location filter input
    field above the input field. This makes it so when the geolocation button is hidden
    initially the layout doesn’t change when the geolocation button shows up.

@monfresh Ready for review and merge. Aligns code here with that in smcgov#49

- Geolocation button was showing up when geolocation was not supported
(IE8). This hides the button by default and displays it only when
geolocation is supported.
- Removes unneeded ERB.
Fixes #503 - Moves geolocation button on inside location filter input
field above
the input field. This makes it so when the geolocation button is hidden
initially the
layout doesn’t change when the geolocation button shows up.
@anselmbradford
Copy link
Member Author

Looks like:

screen shot 2014-09-03 at 4 13 43 pm

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 3190908 on default-hide-geolcation into f1262b2 on master.

@anselmbradford
Copy link
Member Author

This also hides geolocation in IE9, which would make #405 moot.

@monfresh
Copy link
Member

monfresh commented Sep 4, 2014

The button is always hidden for me, even in browsers that support geolocation. I reset Safari to clear all cookies and cache. I tried adding console.log('geolocation is supported'); under if(navigator.geolocation), but I never see anything in the log.

@anselmbradford
Copy link
Member Author

Try adding console.log(navigator.geolocation) above if (navigator.geolocation) { (e771258#diff-2793a1cdbb8ee2f568e44a91bb9f10ddL23). Do you see anything logged?

@monfresh
Copy link
Member

monfresh commented Sep 4, 2014

Don't see anything logged with that either. Is it working for you?

@monfresh
Copy link
Member

monfresh commented Sep 4, 2014

If I remove the "hide" from the class, I can see the button, so it sounds like the conditional is not passing, and therefore the class removal never happens.

@anselmbradford
Copy link
Member Author

Yes, I opened Safari and performed a reset of all settings and was not able to repeat. This code has also been checked on SauceLabs VMs and does not show the button on IE8/IE9 there, but does otherwise.

If you don't see the console log above the conditional it means that script isn't running at all. Check that you don't have precompiled assets in public/assets/ or tmp

@anselmbradford
Copy link
Member Author

Just confirmed it's showing on SauceLabs VMs:

  • Safari 7 on Mavericks
  • Chrome35 on Mavericks
  • FF30 on Mavericks
  • FF32 on Win7

It's not showing on IE8 as expected, but it is showing on IE9, which is actually the expected behavior. I guess I didn't wait long enough last time (#405 is still relevant then).

@monfresh
Copy link
Member

monfresh commented Sep 4, 2014

Ah! Good catch. I did have public/assets. I must have precompiled locally a while back and forgotten about it. Removing them fixed it. I bet you that's probably what's causing the google translate issue as well.

@monfresh
Copy link
Member

monfresh commented Sep 4, 2014

Good to merge. Sorry for the confusion!

@anselmbradford
Copy link
Member Author

Ah, cool, no worries. Yeah that may explain it because the script in a view wouldn't be considered an asset so if the script is removed in a view partial that would update, but if that code is moved to a JS asset (as is the case in the goog translate branch) that wouldn't update because the JS that got loaded in would be pulled off the precompiled assets.

anselmbradford added a commit that referenced this pull request Sep 4, 2014
@anselmbradford anselmbradford merged commit 723577d into master Sep 4, 2014
@anselmbradford anselmbradford deleted the default-hide-geolcation branch September 4, 2014 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Services Near Me on filter above input field
3 participants