-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Resizable: modified resizable containment plugin to restrict resizing within container. Fixes #7018 Resizable: resizing can move objects #1122
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
The approach seems fine to me. I have some minor nits, which I'll report now just to avoid saying them later:
|
@mikesherov added unit test cases and your suggested changes. |
@@ -123,6 +123,27 @@ test("aspectRatio: 'preserve' (ne)", function() { | |||
equal( target.height(), 70, "compare minHeight"); | |||
}); | |||
|
|||
test( "aspectRatio: ticket-7018", function() { |
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.
ticket-7018
-> #7018
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.
We should avoid ticket references in unit tests. Describe what the test is about instead, like all other tests do.
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.
Yes. The test name should be descriptive of the test. Ticket references should be in comments.
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.
Is this a good name aspectRatio:position
? i am very bad in naming variables
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.
I was under the impression that test names should reference ticket number along with good description. I thought we were just getting rid of *_tickets.js. It's helpful to see the ticket number in the runner output.
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.
I'm ok with that, as long as the test name is descriptive. I just don't think the fact that a ticket existed is actually important in the output.
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.
@scottgonzalez I'm fine either way, but I do personally think the fact that a ticket existed is important, I always look back at fiddles.
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.
removed ticket ref from test output, but added #ticket as comment in code.
@dekajp, thanks again for all your hard work! I did a review and once you make those minor changes, I can land this! |
@mikesherov thank you !! whats your preference - do you want me to push new changes in separate commit or you want me to update original commit ? |
@dekajp single updated commit is preferred. |
… within container. Fixes #7018 Resizable: resizing can move objects
@mikesherov seems http://bugs.jqueryui.com/ticket/9107 is related to this . here is the fixed fiddle -http://jsfiddle.net/Mm2Ed/3/ ( minor change - do you want me to add this change in this commit or i can submit a new PR based on this . |
Add it to this, but edit the commit message. Thanks again for all your hard work! |
I am trying to add a test case - example in fiddle (http://jsfiddle.net/c2Rux/16/) it seems that i can not simulate this |
ah !! i think i got the problem , i created some room for mouse move by making the container |
… within container. Fixes #7018 Resizable: resizing can move objects and Fixes #9107 Resizable: aspectRatio and containment not handled correctly
Fixes #9107 Resizable: aspectRatio and containment not handled correctly
Fixes #7018 Resizable: resizing can move objects
Just want to check if this approach is ok ? for fiddle link - http://jsfiddle.net/dekajp/c2Rux/14/
adding
prevSize
andprevPosition
in the plugin parameter object. so that if resize breaks then it can be restored.this PR is not complete - does not include unit testing. ( Fixes #7018 ). also i found some minor code style issues , so i fixed them.