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

review addDOMLoadEvent #2

Open
mnot opened this issue Dec 24, 2011 · 4 comments
Open

review addDOMLoadEvent #2

mnot opened this issue Dec 24, 2011 · 4 comments

Comments

@mnot
Copy link
Owner

mnot commented Dec 24, 2011

Make sure that addDOMLoadEvent is still relevant / correct, and plays nicely with jquery, etc.

@yellow1912
Copy link

I see this one is still open. I have a different comment on it: I wonder if we should auto run hinclude, in some cases we want to do something first before triggering it. With the current code it is not possible.

The easiest way is to completely remove this line: hinclude.addDOMLoadEvent(function () { hinclude.run(); });

The second way, is that within the run method we can check for some configuration such as var load = this.get_meta("include_load", "custom");

What do you think?

@mnot
Copy link
Owner Author

mnot commented Oct 23, 2017

I don't think hInclude should take over the DOM loading infrastructure; there are plenty of libraries out there for that.

@yellow1912
Copy link

Actually, what I mean to say is that hinclude should not automatically trigger on domload event the way it is working right now. There are use cases when we want to manually trigger hinclude instead.

@leroy0211
Copy link

Seems like that function is being used as constructor.

Maybe refactor it to be like this

function hinclude(){
     // code from addDOMLoadEvent
}
hinclude.prototype = { ... }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants