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

(DO NOT MERGE) Orient screen to the top when clicking on hour glass in inventory #4330

Closed
wants to merge 1 commit into from
Closed

(DO NOT MERGE) Orient screen to the top when clicking on hour glass in inventory #4330

wants to merge 1 commit into from

Conversation

crookedneighbor
Copy link
Contributor

Closes #4326

When routing to timetravelers, makes window automatically switch to the top of the window.

hour

scroll to

@crookedneighbor crookedneighbor changed the title Closes #4326 Orient screen to the top when clicking on hour glass in inventory Dec 4, 2014
@crookedneighbor
Copy link
Contributor Author

I assume adding:

controller: function(){
    window.scrollTo(0, 0);
}

to the state change for the time travelers page is fine, unless someone else has a better idea.

@paglias
Copy link
Contributor

paglias commented Dec 5, 2014

@crookedneighbor thanks! do you know if it's happening somewhere else too? I think it was one of the bug for which @lefnire forked angular-ui-router and that might have reappeared with the upgrade

@paglias
Copy link
Contributor

paglias commented Dec 5, 2014

we could use this hack everywhere?

@crookedneighbor
Copy link
Contributor Author

@paglias This is the only place I've experienced it. Once this gets merged in, I'll keep a look out for if it appears elsewhere and just patch it directly.

@paglias
Copy link
Contributor

paglias commented Dec 5, 2014

@crookedneighbor just tested, for me it happens everywhere, it scroll to the position of the old page. Using Chrome

@crookedneighbor
Copy link
Contributor Author

Well, yes, it happens everywhere, cause it's loading in the data, rather than refreshing the page, but it has only affected me adversely with the mystic hourglass, because the link is at the bottom of the page.

Now that I think about it though, clicking on the header menu buttons should result in the same thing.... and... they do. You're right, it's affecting my experience on more than just the hourglass.

I wonder if there's an easy way to affect $state.go to use this bit of code with every change?

@crookedneighbor
Copy link
Contributor Author

Here's a note from public/js/app.js

// @see https://github.com/angular-ui/ui-router/issues/110 and https://github.com/HabitRPG/habitrpg/issues/1705
// temporary hack until they have a better solution
.value('$anchorScroll', angular.noop)

@paglias
Copy link
Contributor

paglias commented Dec 5, 2014

@crookedneighbor yeah, I'm trying with autoscroll as described here http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-view but doesn't work

As for anchor scroll they suggest a differe code now, will try

@crookedneighbor
Copy link
Contributor Author

This is the PR that closed that ui issue.

angular-ui/ui-router#715

Edit: I see @lefnire referenced that PR is some commits.

@paglias
Copy link
Contributor

paglias commented Dec 5, 2014

yeah, trying with $uiViewScrollProvider but it says it doesn't exists, I hope it's because I didn't updgrade

@paglias
Copy link
Contributor

paglias commented Dec 5, 2014

@crookedneighbor I'm a bit lost, even $uiViewScrollProvider.useAnchorScroll(); does nothing. Here is an example on how to apply your code to every router if you want to try angular-ui/ui-router#110 (comment)

Just be sure that challenges are correcly opened in the challenges list

@crookedneighbor
Copy link
Contributor Author

Oh, of course, the challenges. The scrolling to challenges is broken on production, at least when clicking on a guild challenge link and going to the challenges page. I always have to scroll around to find the open challenge.

Here's an issue for it: #1797

@crookedneighbor crookedneighbor changed the title Orient screen to the top when clicking on hour glass in inventory (DO NOT MERGE) Orient screen to the top when clicking on hour glass in inventory Dec 6, 2014
@crookedneighbor
Copy link
Contributor Author

Marking this as do not merge since it looks like it's a wider spread issue than just the hourglass.

@crookedneighbor
Copy link
Contributor Author

Going to work on this from a fresh checkout.

@crookedneighbor crookedneighbor deleted the scroll-to-when-going-to-time-travelers branch September 17, 2016 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants