Skip to content

Draggable: Modified to account resizable handles size in document containment mode, used by ui.dialog. Fixed #9521 ui.Dialog: Resizable dialogs move/resize out of viewport boundary - which results in scrollbar in window #1086

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

Closed
wants to merge 2 commits into from

Conversation

dekajp
Copy link
Contributor

@dekajp dekajp commented Sep 22, 2013

Draggable: Modified to account resizable handles size in document containment mode, used by ui.dialog. Fixed #9521 ui.Dialog: Resizable dialogs move/resize out of viewport boundary - which results in scrollbar in window

…tainment mode, used by ui.dialog. Fixed #9521 ui.Dialog: Resizable dialogs move/resize out of viewport boundary - which results in scrollbar in window
@mikesherov
Copy link
Member

@dekajp, thanks for contributing! There are several issues with the patch that need addressing:

  1. The unit tests belong in draggable, not dialog, because that's where the bug is being fixed.
  2. You're attaching a few unnecessary properties to the instance... See comments inline.
  3. You are using unnecessary bit wise logic to determine a truthy value for .attached, which is itself an unnecessary var... See comments inline.

_isResizableHandlersAttached: function (){
var handle;
this.resizableHandle = this.resizableHandle || {};
this.resizableHandle.attached = 0;
Copy link
Member

Choose a reason for hiding this comment

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

This property is unnecessary. You're only using it in one spot, and only to avoid subtracting zero from a number.

@mikesherov
Copy link
Member

I'm going to close this pull request for now. @dekajp , I encourage you to submit a new one with corrections if you'd like. Thanks again!

@mikesherov mikesherov closed this Sep 22, 2013
@dekajp
Copy link
Contributor Author

dekajp commented Sep 22, 2013

@mikesherov Thanks for all your comments , i will make the changes and resubmit code.

@scottgonzalez
Copy link
Member

@dekajp If you send a new PR, please take a new approach. Draggable cannot directly query for resizable-related code. This is a generic problem that needs to be solved.

@dekajp
Copy link
Contributor Author

dekajp commented Sep 22, 2013

@scottgonzalez , if draggable can not directly query resizable-handles , so what other way you suggest ? i assumed it is safe to query the resizable handles.

@dekajp
Copy link
Contributor Author

dekajp commented Sep 23, 2013

@scottgonzalez ,

  1. To query whether element is resizable - is to query whether the handles are attached to it. by query .ui-resizable-xx css class . Is this ok ? are you looking for other approach .
  2. _calculateResizableHandleOverflow which will calculate the excess width and height by querying the resizable handles needs to go in some common interface . this can be possible by either moving this code to base class or a common util class . what will you prefer ?

@dekajp
Copy link
Contributor Author

dekajp commented Sep 23, 2013

@scottgonzalez , further looking into code in core class , i think we can query resizable similar to tabbable and focusable

@scottgonzalez
Copy link
Member

The resizable handles are causing a problem, but the problem is not that they are resizable handles. You need to address the cause, not the symptom.

@dekajp
Copy link
Contributor Author

dekajp commented Sep 23, 2013

@scottgonzalez if i understand correctly since resizable handles are causing issue we can change css style on resizable handles , so that they will not overflow the parent element boundary .

@scottgonzalez
Copy link
Member

Modifying the resizable CSS is fine, though you probably want to modify the dialog CSS instead, since that's where the problem actually exists.

@dekajp
Copy link
Contributor Author

dekajp commented Sep 23, 2013

@scottgonzalez ,i am going to look at css both dialog and resizable after work . I re-read several times your above comment You need to address the cause, not the symptom to understand it - what you actually meant. I am glad i am getting close in approach .

@dekajp
Copy link
Contributor Author

dekajp commented Sep 24, 2013

@scottgonzalez , I could replicate the issue with [Dragger + Resizable] and [Dialog + Dragger + Resizable]

But by overriding the styles - ( actually overriding the positions of resizable handles ) the problem can be fixed. Let me know if this approach looks good to you.

http://jsfiddle.net/dekajp/N22vY/

@scottgonzalez
Copy link
Member

It's really hard to tell what's changing by looking at a fiddle, but I'm assuming you just changed the left/top for the dialog's SE handle. That's fine, as long as we don't regress on http://bugs.jqueryui.com/ticket/4575.

@dekajp
Copy link
Contributor Author

dekajp commented Sep 25, 2013

just want to let you know i am looking at this http://bugs.jqueryui.com/ticket/4575 (http://jsfiddle.net/bchiasson/Lfx8J/5/) and the fiddle in it i can see the SE image . updated fiddle to latest version of jquery-ui 1.10.2 i can not see the SE image in (Chrome 29, Opera 16 and FF 23 ) in MacOS http://jsfiddle.net/Lfx8J/24/ . i am not sure if this is a defect or expected behavior. can you please confirm .

@scottgonzalez
Copy link
Member

You shouldn't see it. It was intentionally removed.

@dekajp
Copy link
Contributor Author

dekajp commented Oct 3, 2013

New Pull request - #1092

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.

3 participants