Bug Tracker

Opened 15 years ago

Closed 15 years ago

#1682 closed enhancement (fixed)

Resizable containment option

Reported by: dgouldin Owned by: paul
Priority: major Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:


Add a containment option to resizable with the same behavior as the drggable containment option.

See Google Groups thread for more info: http://groups.google.com/group/jquery-ui/browse_thread/thread/b67134155d012f5d

Attachments (1)

resizable_containment.diff (3.5 KB) - added by dgouldin 15 years ago.
Updated resizable containment implementation

Download all attachments as: .zip

Change History (5)

comment:1 Changed 15 years ago by c_t


I think your enhancement is great. However, there are problems, if one of the resizeable's parent nodes is positioned relative or absolute. In that case the left and top offsets of these parent nodes must be subtracted from the left- and top-value that will be used for the containment calculations (i.e. the first to elements of options.containment ).

If the parentNode itsself is positioned relative or absolute everything's quite easy, then options.containment should just look like (around line 65):

  			options.containment = [
  				(ce.offsetWidth || ce.scrollWidth),
  				(ce.offsetHeight || ce.scrollHeight)

However if one of the other parent nodes are positioned things get more difficult I guess.

At the moment I have no really good idea how to fix this properly...

Thanks anyways.

Changed 15 years ago by dgouldin

Attachment: resizable_containment.diff added

Updated resizable containment implementation

comment:2 Changed 15 years ago by dgouldin

Thanks for the suggestion. I took some more inspiration from draggable and am now taking parent node offsets into account. I think this solves the issue you were referring to.

comment:3 Changed 15 years ago by paul

Owner: set to paul
Status: newassigned

comment:4 Changed 15 years ago by paul

Resolution: fixed
Status: assignedclosed

okay, added.

Note: See TracTickets for help on using tickets.