jQuery UI 1.7 Upgrade Guide
link Overview
This guide will assist in upgrading from jQuery UI 1.5.x to jQuery UI 1.7.x. All changes are listed below, organized by plugin, along with how to upgrade your code to work with jQuery UI 1.7.
link Accordion
- Renamed
alwaysOpenoption tocollapsible(alwaysOpenis deprecated, to be removed in next release). - Removed
selectedClassfor consistency reasons to the CSS Framework. - Added
resize()method. - Added
changestartcallback that is triggered before the animation starts. - Removed deprecated separate jQuery method
.activate()(useaccordion( "activate" )instead). - Improved default for
headeroption, removing the need to specify the option in 99% of all accordions.
link Datepicker
- Removed options:
clearStatusclearTextcloseAtTopcloseStatuscurrentStatusdateStatusdayStatushighlightWeekinitStatusmandatorymonthStatusnextBigStatusnextBigTextnextStatusprevBigStatusprevBigTextprevStatusrangeSelectrangeSeparatorshowBigPrevNextshowStatusshowWeeksstatusForDateweekHeaderweekStatusyearStatus
- Modified options:
changeMonth to defaultfalse- wastrue`changeYear to defaultfalse- wastrue`
- Added options:
showButtonPanel(defaultfalse)
- Added localizations:
- Serbian
- Greek
- Malaysian
- Albanian
- Persian
- Esperanto
- Croatian
link Dialog
- Related events are now passed to all triggered events/callbacks (so for
example
keyCodeinformation is now available). - Removed
optionsandelementfromuihash. - Removed
overlayoption (workaround: use the CSS Framework to style the overlay). - The default
heightis now set to"auto"so it stretches the dialog by default to the content height. - Removed
autoResizeoption (now always auto resizes). - Added
closeTextoption (default"close"). - Added
beforeclosecallback for dialogs (can prevent closing the dialog by returningfalse). - Added
ui-dialog-draggingandui-dialog-resizingduring drag and resize. - Removed (undocumented) options:
dragHelper,resizeHelper. If you need to hide a dialog's contents during drag (for performance reasons), here are two work-arounds:
CSS:
|
1
2
3
|
|
JS:
|
1
2
3
4
5
6
7
8
|
|
link Draggable
- Removed
optionsfromuihash. - Deprecated
absolutePositioninuihash, useoffsetinstead. - Added
addClassesoption. connectToSortableoption now accepts selectors.- Padding is now taken account in
containment(previously, you could drag "beyond" the padding). - Added a
revertDurationoption sincerevertno longer checks for numbers. - Implemented more advanced features to the
snapoption - you can now pass in an object instead of a boolean intosnap, possible keys are the callbackssnap/release(which both receiveui.snapItem) anditems(jQuery selector, defaults to:data(draggable)).
link Droppable
- Added
addClassesoption. - Deprecated
absolutePositioninuihash, useoffsetinstead. - In the
acceptfunction the context (this) is now the DOMElement, not a wrapped jQuery object.
link Sortable
- Added support for
helper: "original". This way, the original element is dragged while the placeholder gets reordered in the DOM, and onmouseup, the DOM positions of placeholder and original switch. This is the recommended mode from now on because it doesn't involve copying the element. For legacy reasons, if you want to have it behave exactly like the old sortables, set the helper option to"clone". appendTooption is ignored if the helper option is set to"original"(which is the default).- Added
forcePlaceholderSizeoption to force setting the height and width of the placeholder to the height and width of the clicked element. - Implemented the option
connected(boolean), for theserialize()method to also serialize connected lists. - Stop logic overhaul:
stop(and all other events that are fired on end (receive,update,remove,deactivate)) is triggered after everything else has been normalized (placeholder and helper removed, position restored).- For old behavior (for example to be able to check something on the
placeholder at end), introduced new
beforeStopcallback.
- If a
keyoption is specified tosortable( "serialize" ), brackets are no longer automatically added to it. - New cancelling logic:
- If you want to completely cancel a sort (practically undo the ongoing sort),
return
falsein any of the callbacks. - Or instead, call the
cancel()method on the sortable.
- If you want to completely cancel a sort (practically undo the ongoing sort),
return
- Refactored intersection logic:
- Removed
"guess"tolerance. - Introduced intelligent
"intersect"tolerance (default).
- Removed
connectWithoption now accepts selectors.- Deprecated
absolutePositioninuihash, useoffsetinstead. - Padding is now taken account in
containment(previously, you could drag "beyond" the padding).
link Selectable
- Removed
elementandoptionsfromuihash. - Added missing
ui-selectable-helperclass to helper/lasso element.
link Slider
axisoption was changed toorientationfor consistency with other plugins.handleoption removed.handlesoption removed.- You can create custom handles manually and then simply add the class
ui-slider-handleand the slider will pick them up (not auto-gen).
- You can create custom handles manually and then simply add the class
ui.handleproperty (in callback function) was changed to a DOMElement, instead of a jQuery object.- Change
ui.handleto$( ui.handle ).
- Change
steps/steppingoptions removed in favor ofstepoption.startValueandmoveToremoved in favor ofvalueandvaluesoptions and methods.roundoption removed.distanceoption removed.noKeyboardoption removed.- New range options:
minandmax. - Handles are now left-aligned at the value. To center-align them, give the
handle a negative
margin-leftofhandlewidth / 2. For example:
|
1
2
3
4
|
|
For vertical slider handles, do the same with height and margin-bottom.
link Resizable
- Changed options:
alsoResizenow accepts selector.
- Removed options:
transparent(workaround: use CSS).preserveCursor(there's no usecase forpreserveCursorset tofalse).proportionallyResize(usealsoResizeinstead).knobHandles
link Tabs
- Markup requires a container for list and panels, thus can no longer tabify a
<ul>directly. Instead, must call.tabs()on the containing element. In other words, replace$( "#tabs > ul" ).tabs();with$( "#tabs" ).tabs();. - Removed
optionsfromuievent object. - Renamed
deselectableoption tocollapsible(deselectableis deprecated, to be removed in next release). - Deprecated
nullas value forselectedoption in order to initialize tabs without active tab, instead use-1. - Removed ability to change class names via options.
- Added
abort()method to terminate running ajax tab requests and animations. cookieoption accepts additionalnameproperty.- States for hover and focus (
.ui-state-hover,.ui-state-focus) added. - Default value for
spinneroption changed to"<em>Loading…</em>"(beforeemwas added internally).