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

New architecture: prototype pattern #149

Merged
merged 2 commits into from
Nov 30, 2015

Conversation

Indigo744
Copy link
Collaborator

Implements #117

This one is huge!
Now, $.fn.mapael is only a lightweight function wrapper to jquery to build a new object.
$.mapael is now an prototype object that is instanciated on an element.
The constructor only init some internal variable and call init().
The main modification is that this shall be use to address the current mapael object (and not Mapael anymore!). You will see that I usually assign self as this at the top of a function in order to avoid misleading name.

For the next step, there are a lot of function that can be simplify due to being in an object. For instance, a lot of internal function make use of $container as parameter, whereas it could simply be accessible from self.$container. But this will make another PR. This one is already big :)

@neveldo
Copy link
Owner

neveldo commented Nov 30, 2015

Great refactoring, thank you ! All the modifications seems to be ok :)

neveldo added a commit that referenced this pull request Nov 30, 2015
@neveldo neveldo merged commit 45d2221 into neveldo:master Nov 30, 2015
@Indigo744 Indigo744 deleted the Indigo744-patch-newarch-prototype branch December 3, 2015 09:31
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

Successfully merging this pull request may close these issues.

2 participants