trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Add support for jQuery UI 1.12 API #894

Open mdprw opened 8 years ago

mdprw commented 8 years ago

jQuery UI 1.12 introduces API redesigns for Button, Buttonset, Dialog, Draggable, Droppable, Menu, Mouse, Resizable, Selectable, Sortable, Tabs, Tooltip, and Effects. Although the redesigns introduce breaking changes, 1.12 maintains a lot of compatibility with the 1.11 API by default. This is accomplished by rebuilding the 1.11 API on top of the 1.12 API. The default behavior for all 1.12 releases will be to simultaneously use the 1.11 and 1.12 APIs where possible. If you would like to load just the 1.12 API without the 1.11 API, you can set the $.uiBackCompat flag to false.

<script src="jquery.js"></script>
<script>$.uiBackCompat = false;</script>
<script src="jquery-ui.js"></script>

I'm using UI lightness Theme and i noticed that the icon used in the combo to open the dropdown ".ui-icon-triangle-1-s" is moved one pixel to left, so to set icon to the same exact position as before you'll have to update jQuery UI stylesheet accordingly.

Jupakabra commented 8 years ago

Is this backward compatible with jQuery UI 1.11? Because I dont see controlgroup being declared in 1.11 for this to work.

trentrichardson commented 8 years ago

This is not backwards compatible according to the author of the pull request:

https://github.com/trentrichardson/jQuery-Timepicker-Addon/issues/891

Work will need to be done to make it compatible, or draw a line in the sand declaring support only for jquery ui 1.12+. I'd prefer it be backwards compatible, but I would have to look at the required changes.

mdprw commented 8 years ago

@Jupakabra @trentrichardson This PR is not compatible with jQuery UI 1.11:

If you want to support older versions you should detect if the user is using version 1.12 and set $.uiBackCompat flag to false (which "disables" API for version 1.11) to provide the code of this PR and apply the changes to the stylesheet. Otherwise use the old code and css.