ivaldi / brimir

Email helpdesk built using Ruby on Rails and Zurb Foundation
http://getbrimir.com
GNU Affero General Public License v3.0
1.38k stars 299 forks source link

Problems with onfocus/onblur #359

Closed jamgregory closed 7 years ago

jamgregory commented 7 years ago

We're experiencing some issues with the onfocus/onblur code, especially if trying to visit other sites when Brimir is open.

I wonder if it would be preferable to re-render the page (perhaps via Ajax) instead of refreshing the whole page?

frenkel commented 7 years ago

Would be possible, but more chance of bugs where some counter somewhere wouldn't update (for example). What kind of issues are you experiencing? Maybe it's simpler to solve those.

jamgregory commented 7 years ago

The primary issue we're seeing (and maybe it's Chrome specific, I'm not sure) is that if you have the Brimir main ticket view open, if you go to enter a URL or click a bookmark, the webpage will intercept the change and refresh the page - so you end up back at the Brimir home page, rather than the link you wanted to open.

frenkel commented 7 years ago

Well that's weird and annoying indeed. When I click the location bar or the search bar, nothing happens until I click in the content of the tab (Firefox). Which browser are you using?

jamgregory commented 7 years ago

I've been seeing it in Chrome, and my colleague also uses Chrome and has been reporting the same issue.

frenkel commented 7 years ago

It looks like we can fix this by using a different method, based on https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API. We just need to find the time to implement it...

jamgregory commented 7 years ago

Thanks for merging that @frenkel. Do you know if a new release of Brimir is imminent, or should I just use master for now?

frenkel commented 7 years ago

@jamgregory I think it's safe to use master for now, we don't have any breaking this planned between now and the next release.