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

Marketplace when closing popover it scrolls to top #7798

Closed
Globulopolis opened this issue Apr 30, 2015 · 4 comments
Closed

Marketplace when closing popover it scrolls to top #7798

Globulopolis opened this issue Apr 30, 2015 · 4 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@Globulopolis
Copy link
Contributor

Hi!
I've found that the page scroll to top every time when the plugin info modal close or mouse click on the grey area outside of the modal.
I think that this is wrong behavior, because we lose focus on information which we see.

@mattab
Copy link
Member

mattab commented May 1, 2015

Thanks @Globulopolis for the feedback we didn't notice that one.

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label May 1, 2015
@mattab mattab added this to the Piwik 2.14.0 milestone May 1, 2015
@tsteur
Copy link
Member

tsteur commented May 6, 2015

It is caused by this: https://github.com/piwik/piwik/blob/2.13.0-rc3/plugins/CoreHome/javascripts/popover.js#L47

This will call https://github.com/piwik/piwik/blob/2.13.0-rc3/plugins/CoreHome/javascripts/broadcast.js#L381 which causes the page to scroll to top here: https://github.com/piwik/piwik/blob/2.13.0-rc3/libs/jquery/jquery.history.js#L14

This won't be an easy fix. We could store the current scroll position and restore it afterwards but then it the page will jump. According to eg this blog post we could use the actual history API: http://lea.verou.me/2011/05/change-url-hash-without-page-jump/ . The history plugin that we use is outdated and no longer maintained since beginning 2012 : http://tkyk.github.io/jquery-history-plugin/ . Maybe we should consider using another history plugin. The author of this plugin recommends the following plugin: https://github.com/cowboy/jquery-hashchange

@sgiehl any thoughts here maybe?

@diosmosis
Copy link
Member

I think this can be solved easily w/ a proxy in between broadcast & jquery's history plugin. I'll work on a PoC.

diosmosis pushed a commit that referenced this issue May 9, 2015
…ssue. Fix involves using angular service that uses the singleton instead of jquery's history plugin. Can remove the history plugin after this change.
@diosmosis
Copy link
Member

Fixed the issue in a PR (#7869) w/o a new library. Instead of using jquery's history plugin, we can just use angular's $location object. Works pretty well as far as I can tell.

diosmosis pushed a commit that referenced this issue May 12, 2015
…ssue. Fix involves using angular service that uses the singleton instead of jquery's history plugin. Can remove the history plugin after this change.
diosmosis pushed a commit that referenced this issue May 13, 2015
…ssue. Fix involves using angular service that uses the singleton instead of jquery's history plugin. Can remove the history plugin after this change.
@mattab mattab changed the title Document scroll to top issue in marketplace Marketplace when closing popover it scrolls to top Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants