Skip to main content

Search and Top Navigation

#1682 closed enhancement (fixed)

Opened September 19, 2007 05:19PM UTC

Closed September 28, 2007 11:48AM UTC

Last modified February 26, 2009 11:08AM UTC

Resizable containment option

Reported by: dgouldin Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

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 (0)
Change History (6)

Changed September 21, 2007 03:47PM UTC by c_t comment:1

Hi!

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 = [
  				0,
  				0,
  				(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 September 21, 2007 04:36PM UTC by dgouldin comment:2

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.

Changed September 24, 2007 04:20PM UTC by paul comment:3

owner: → paul
status: newassigned

Changed September 28, 2007 11:48AM UTC by paul comment:4

resolution: → fixed
status: assignedclosed

okay, added.

Changed May 24, 2008 03:39AM UTC by comment:5

milestone: 1.2.2

Milestone 1.2.2 deleted

Changed February 26, 2009 11:08AM UTC by paul comment:6

milestone: → 1.5