Skip to content

Resizable: modified resizable containment plugin to restrict resizing within container. Fixes #7018 Resizable: resizing can move objects#1122

Closed
dekajp wants to merge 2 commits into
jquery:masterfrom
dekajp:ticket-7018
Closed

Resizable: modified resizable containment plugin to restrict resizing within container. Fixes #7018 Resizable: resizing can move objects#1122
dekajp wants to merge 2 commits into
jquery:masterfrom
dekajp:ticket-7018

Conversation

@dekajp
Copy link
Copy Markdown
Contributor

@dekajp dekajp commented Oct 29, 2013

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 and prevPosition 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.

@mikesherov
Copy link
Copy Markdown
Member

The approach seems fine to me. I have some minor nits, which I'll report now just to avoid saying them later:

  1. A lot of the comments you're fixing are unnecessary to begin with. Rather than fix them, remove them if they don't mention a ticket number or a browser they're supporting. If they do mention a browser, please augment the comment to include a line: // support: IE. There a lots of examples in the code base.
  2. Your style of declaring an empty object and then assigning individual properties should be replaced with a single declaration with the properties defined during the declaration.

@dekajp
Copy link
Copy Markdown
Contributor Author

dekajp commented Oct 31, 2013

@mikesherov added unit test cases and your suggested changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ticket-7018 -> #7018

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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.

@mikesherov
Copy link
Copy Markdown
Member

@dekajp, thanks again for all your hard work! I did a review and once you make those minor changes, I can land this!

@dekajp
Copy link
Copy Markdown
Contributor Author

dekajp commented Oct 31, 2013

@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 ?

@mikesherov
Copy link
Copy Markdown
Member

@dekajp single updated commit is preferred.

… within container. Fixes #7018 Resizable: resizing can move objects
@dekajp
Copy link
Copy Markdown
Contributor Author

dekajp commented Nov 4, 2013

@mikesherov seems http://bugs.jqueryui.com/ticket/9107 is related to this . here is the fixed fiddle -http://jsfiddle.net/Mm2Ed/3/ ( minor change - continueResize=false in re calculation of left and top coord.

do you want me to add this change in this commit or i can submit a new PR based on this .

@mikesherov
Copy link
Copy Markdown
Member

Add it to this, but edit the commit message. Thanks again for all your hard work!

@dekajp
Copy link
Copy Markdown
Contributor Author

dekajp commented Nov 5, 2013

I am trying to add a test case - example in fiddle (http://jsfiddle.net/c2Rux/16/) it seems that i can not simulate this

the last drag [-10,-10] does not work !!
jqueryui

@dekajp
Copy link
Copy Markdown
Contributor Author

dekajp commented Nov 5, 2013

ah !! i think i got the problem , i created some room for mouse move by making the container absolute left:100 ,top:100 after that it worked

… within container. Fixes #7018 Resizable: resizing can move objects and Fixes #9107 Resizable: aspectRatio and containment not handled correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants