- Notifications
You must be signed in to change notification settings - Fork 5.3k
Draggable: enabled draggable from within iframe. Fixed #5727 - draggable: cannot drag element inside iframe #954
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
Conversation
…ging of element inside iframe, fixes #5727 (Draggable: cannot drag element inside iframe)
…ging of element inside iframe, fixes #5727 (Draggable: cannot drag element inside iframe)
Conflicts: ui/jquery.ui.core.js ui/jquery.ui.draggable.js ui/jquery.ui.mouse.js
Hi @bgrins, you don't need to open new pull requests for feedback, you can just push up new commits. I have a few more comments to add, please just add and push up commits on the existing branch and the PR will reflect those changes automatically. |
ui/jquery.ui.draggable.js Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.document[ 0 ]
<--- notice the spacing.
@mikesherov Sorry, I was unable to get a clean single commit with squashing after I had merged in from upstream. I was hoping that the discussion could happen on this branch, which is already flattened into a single commit. This way, I could just amend the existing commit to remain within the contribution guidelines. If it is important that the discussion happens over on the other PR I could give it another shot, but it had turned into a big time sink for me. |
ui/jquery.ui.mouse.js Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this._mouseUp( event );
So I've asked you to clean up existing bad styles in the lines you've modified. Thanks for doing that! The last thing we need is a unit test supporting this change. Can you whip one up? |
tests/unit/draggable/draggable.html Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append the iframe
programmatically in the test please.
@mikesherov I have pushed up a test, but it is not yet working. I think it could be because the I will take a look at it later. |
Actually, I'll clean up the rest of your styles when I pull in these changes. But just be aware of the various spacing violations in case you'd like to contribute further! Thanks again! Have you signed our CLA yet: http://contribute.jquery.org/CLA/ ? |
Yeah, the HTML gets reset after every test to maintain test isolation, so that's not it. It might be due to simulate's weirdness. Please see if there's anything you need to change there to get it to work. |
@mikesherov I went ahead and updated the existing styles and will do so on the tests also. As far as I can tell, it is due to
|
I looked into this a little bit more, and for some reason the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the line that I needed to change to get the test to work.
Ah, finally got the test working! Had to make a change to |
Awesome! @bgrins, can you rebase this pull request? |
…ble: cannot drag element inside iframe
Ugh, now it seems to have split it up into multiple commits. I followed these instructions to rebase: https://www.openshift.com/wiki/github-workflow-for-submitting-pull-requests. Which resolved the conflicts and now the feature is working fine, but now the history seems to be messed up. Sorry, but do you have any documentation explaining what I should do instead? |
@bgrins, assuming you have jquery/jquery-ui set to
|
@mikesherov I have done this process, and afterwards I get this message:
If I took a patch between the current branch and master, is there a way for me to wipe out all of my history to make it match with master, apply the patch, and push it all as one commit? Sorry for the hassle, I really don't know how it got so screwed up. It seems to have history from years ago when I first built the patch (in my master branch) along with some of the merges I did along the way when building it this time. |
@bgrins, no worries. I'll rebase it for you when I land this... thanks! |
@mikesherov great! Is there anything else that I can do for this? |
Fixes http://bugs.jqueryui.com/ticket/5727. This allows the ability to call $(element).draggable() when element is inside of an iframe.
Previously, all the mouse handlers were bound to parent document, this PR binds them to the owner document of the element being dragged.
Includes a visual test and minimal unit tests. I have been able to test in Chrome and Firefox.
This cleans up this PR: #909 based on feedback from @mikesherov