Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Calculate button position with scroll top #271

Closed
wants to merge 1 commit into from

Conversation

suskind
Copy link

@suskind suskind commented Feb 3, 2016

Needs to use scroll top to calculate button top position

@j0k3r
Copy link
Collaborator

j0k3r commented Feb 3, 2016

Could you provide a jsfiddle that fail without your change?

@suskind
Copy link
Author

suskind commented Feb 3, 2016

The problem is with jQuery version

Using version 2 (https://code.jquery.com/jquery-2.2.0.js) it fails

I've tried it in your demo (http://linkesch.com/medium-editor-insert-plugin/) using Firefox Addon PourBico replacing
<script src="bower_components/jquery/dist/jquery.js"></script>
with
<script src="//code.jquery.com/jquery-2.2.0.js"></script>
I have 2 samples here using all the resources from your demo but with different jQuery versions

http://cloudpt.pdvel.com/work/medium-editor/test-jquery1.html

http://cloudpt.pdvel.com/work/medium-editor/test-jquery2.html

And btw, in your bower package you have jQuery version 2

@linkesch
Copy link
Owner

linkesch commented Feb 5, 2016

I tried both demos and both work for me correctly. I tried it in Chrome and Firefox. What browser do you use?

@suskind
Copy link
Author

suskind commented Feb 5, 2016

Probably you have a big resolution. In "test-jquery2.html" make it to start having scroll and scroll down a bit and click on the editor to see the button.

@linkesch
Copy link
Owner

linkesch commented Apr 2, 2016

Sorry @suskind, I've completely forgotten about this PR. My bad.

You're right, I was able to reproduce it in Firefox. It looks like Firefox issue, because Chrome works correctly. But your fix also works only in Firefox and screws up Chrome.

Can you think about an universal solution that would work in both jQuery 1 and 2 and in all major browsers?

@trimeyko
Copy link

@orthes near the same issue when editor placed in scrollable container, this can be fixed by relative position of editor itself to handle position more correctly, but in case when editor also have scrolling top calculations doesn't take into mind $p.parent().scrollTop() value.

@linkesch
Copy link
Owner

Fixed in #356

@linkesch linkesch closed this Jul 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants