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

Hot linking update? #37

Open
FlipperPA opened this issue Dec 21, 2015 · 4 comments
Open

Hot linking update? #37

FlipperPA opened this issue Dec 21, 2015 · 4 comments

Comments

@FlipperPA
Copy link

I noticed hot linking as a To-Do list item, and this is a feature I'd love. I tried tinkering myself but have run into a brick wall.

I've got it so it'll auto-pop the gridder panel open by doing the following:

$(window).load(function() {
  index_position = document.URL.indexOf("#");
  if(index_position != -1) {
    anchor_name = document.URL.substring(index_position);
    $(anchor_name).trigger("click");
  }
});

Basically, I pass in the div ID of the item to be expanded as an anchor name in the URL and simulate a click of that panel after the Window has fully loaded. $(window).load occurs after all document ready jQuery functions complete. This works great, however, when I try to mix in a scroll-to, it can't navigate to the proper location on the page, as it is being "painted" in the browser dynamically.

Am I barking up the wrong tree? Did you have an ideas on how to get this working? I've tried a bunch of things and am now beating my head against the wall instead of issuing a useful P.R. :) Thanks for your work on a great plugin!

@orion3dgames
Copy link
Owner

Hello,

Yes, I need to implement it. Too busy at the moment.

To reply to you question, I've not really thought about it.

Your code looks great, except you should not need to add any scrolling, the gridder plugin should scroll automatically to the correct item... Do you have a link I can test?

If you need real url hot link, why not use the other version of gridder I have ( It's a little messy, but works fine once configured correctly ) :
https://github.com/oriongunning/gridder-ajax

Some people struggle to get it working, but if you familiar with how servers work, you will be fine.

Regards,
Orion

@intellisense
Copy link

intellisense commented Aug 2, 2016

@FlipperPA What you are doing is right, but you should do it after the gridder has been initialized e.g. with in onStart and you don't need to add any manual scrolling code:

    $(".gridder").gridderExpander({
        // other options
        onStart: function () {
            index_position = document.URL.indexOf("#");
            if(index_position != -1) {
               anchor_name = document.URL.substring(index_position);
               $(anchor_name).trigger("click");
            }
        },
    });

@orion3dgames
Copy link
Owner

That's exactly it. Thanks @intellisense

@ddaydd
Copy link

ddaydd commented Oct 19, 2017

T'as pris une année sabbatique ou quoi? :p

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

No branches or pull requests

4 participants