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

Scroller fix #1269

Merged
merged 2 commits into from
Jun 23, 2014
Merged

Scroller fix #1269

merged 2 commits into from
Jun 23, 2014

Conversation

SergioCrisostomo
Copy link
Member

fixes #1012, closes #1013

Contrary to the documentation, Scroller Class crashes if window is passed to the Class.

Docs were giving example with window as element. That breaks the code
as described in #1012

This pull request fixes that (source code fix was discussed in #1012, and is included in this p.r.)

This changes also:

  • the example in the docs to something one can copy/paste and see
    it working "out of the box": http://jsfiddle.net/v4yJD/
  • the first parameter info, from element to mixed, since
    code source uses this.element = document.id(element);
@arian
Copy link
Member

arian commented Jun 22, 2014

Maybe it should work on window?

@SergioCrisostomo
Copy link
Member Author

@arian sure, it could work on window if we changed on L88 to this under:

pos = (this.element != this.docBody && this.element != window) ? this.element.getOffsets() : {x: 0, y:0},

jsFiddle: http://jsfiddle.net/9rmHf/

I would still vote for the new docs example, if you think its ok (keeping window information).
Would you prefer that change instead?

@arian
Copy link
Member

arian commented Jun 22, 2014

I'd prefer that indeed.

@SergioCrisostomo
Copy link
Member Author

@arian: updated

@anutron
Copy link
Member

anutron commented Jun 23, 2014

LGTM. Ship it.

arian added a commit that referenced this pull request Jun 23, 2014
@arian arian merged commit 5f82f73 into mootools:master Jun 23, 2014
@SergioCrisostomo SergioCrisostomo deleted the scroller-fix branch June 23, 2014 11:02
@RemkoNolten
Copy link

It looks like this fix is currently not properly implemented. In the current version of Mootools More, the line reads:

pos = ((this.element != this.docBody) && (this.element != window)) ? element.getOffsets() : {x: 0, y: 0},

Which throws a ReferenceError: element is not defined.
I think it should be:

pos = ((this.element != this.docBody) && (this.element != window)) ? this.element.getOffsets() : {x: 0, y: 0},
@SergioCrisostomo
Copy link
Member Author

@RemkoNolten i supose you are right. Do you have the possibility to send a pr to fix this, and eventually a spec also?

Thanks

@RemkoNolten
Copy link

@SergioCrisostomo To be honest: I've never create a push request and/or a spec before, so it would take me considerable time which I (unfortunately) do not have at the moment. (It's about time I learned :))
If time is no issue, I can maybe look into it in the coming weeks.

@SergioCrisostomo
Copy link
Member Author

@RemkoNolten no problem. I will check this out later today. Do take a look here: https://github.com/mootools/mootools-more#contribute when you find time.

Thank you again!

@RemkoNolten
Copy link

@SergioCrisostomo Thanks for your quick response! I've some other patches/fixes (not really bugs) in my version of Mootools which I certainly intend to contribute some day. My lack of knowledge / time is currently prohibiting this, but I will look into the document you suggested soon!

@SergioCrisostomo
Copy link
Member Author

patches are really welcome :)
cheers!

On Wed, Nov 5, 2014 at 11:57 AM, Remko Nolten notifications@github.com
wrote:

@SergioCrisostomo https://github.com/SergioCrisostomo Thanks for your
quick response! I've some other patches/fixes (not really bugs) in my
version of Mootools which I certainly intend to contribute some day. My
lack of knowledge / time is currently prohibiting this, but I will look
into the document you suggested soon!


Reply to this email directly or view it on GitHub
#1269 (comment)
.

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