From galleryformatter.js:
/*
* @FIXME
* Need to figure out a way to update the location bar of the browser, for bookmarking etc, without making the scroll jump
* window.location.hash = this.hash; solution below does update the location, but makes the scroll jump.
*/
We need this functionality, so I'm rolling it. What I did was change the hashtags just a bit in the theme, by adding "-slide" to the li id. The link does not have the additional "-slide", so it doesn't trigger a scrolling jump. However, I've modified the js to go ahead and look for "-slide", so the gallery functionality still works. Then I removed preventDefault() to allow the hashtag to go through to the browser. Presto!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | galleryformatter-986474-2.patch | 2.55 KB | manuel garcia |
| #3 | galleryformatter-986474.patch | 2.17 KB | manuel garcia |
| galleryformatter-hashtags.patch | 2.1 KB | srjosh |
Comments
Comment #1
srjoshComment #2
manuel garcia commentedIndeed that's something waiting to be fixed for some time!
Thanks for the patch srjosh, but patch doesn't apply properly against 6.x-1.x-dev (new features are done allways against dev):
I think its because you created a new dir theme.new?
The easiest way to create a patch is:
cvs diff -up > ~/galleryformatter-[issue-number].patchComment #3
manuel garcia commentedI was curious as to test this myself, so I made the few changes, and created a proper patch if anyone else wants to test this.
Although I admit it's a clever way to do it, I don't like the way we are tricking the browser, seems to me like a hack - a clever hack =)
The main reason not to commit this is that the deep linking would not work without JS turned on, since its the JS that gets the proper hash. In fact, this patch totaly breaks the gallery without JS turned on.
So I'm reluctant to commit this to the module, let's try find a cleaner way perhaps?
Anyone has a better idea?
Comment #4
srjoshIf by deep linking you mean that the url can be used to pick which image is showing on page load, then the changes I made account for that... as does the patch that you posted.
Comment #5
manuel garcia commentedYes srjosh, that works great, but the gallery doesn't work at all with JS turned off.
Comment #6
manuel garcia commentedOK, I gave this a bit more thought, and it could be implemented, but doing the heavy lifting on the JS side, to keep the gallery working without JS enabled, and the deeplinking without js enabled also working.
Here is an updated patch, basicaly adding the sufix to slide ids with JS instead of in the source markup throug the tpl.
I find it works perfectly on chrome, and on FF also if you open a deeplinked gallery, but, weirdly, in FF if I hit refresh on a gallery page that has a hash in the url, it doesnt show the appropiate image, and shows none. Very weird, can anyone else confirm this? I couldn't track down why.
Testers very welcome!
Comment #7
srjoshThis works really well. I experienced the same issue. It seems to have something to do with inheritance/cascading of the css positioning.
in galleryformatter.css, line 2:
.galleryformatter { margin: 0 auto; position: relative; }This seems to fix it.
Comment #8
srjoshComment #9
astonvictor commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks