Datepicker and Dialog Suggestions, Contributing?
Hello Everyone,
This is my first time participating in this group, so please correct
me if there is information I'm leaving out, or if there is a process I
should be following.
I would like to propose some additions to the Datepicker and Dialog
included with jQuery.UI. I'm presently using the latest stable version
(1.7).
Datepicker
a - Option allowing the current date to be selected, and the
Datepicker closed when 'today' is clicked.
b - Option/Change for rendering the month and year select elements as
div/ul-li.
Dialog
a - width: auto;
Datepicker.a
We're currently using a custom rolled solution very similar to the
one included with jQ.ui. This is a functionality that the users of
this control have become very used to using. At present, the 'Today'
button does nothing more than take you back to the month/year of the
current date. It doesnt select it, nor does it close the dialog. Many
calendar/datepicker scripts available on the net today follow the
ideaology of selecting the current day and either closing the dialog
or allowing the user to close the dialog.
Datepicker.b
When our custom script was first put together, we chose to go with
the easy to use <select> element for this purpose. However, we chose
to go with a ul/li solution as it was both compact, and allowed us to
style our custom dropdowns in order to make it appear identical on
each browser.
Dialog.a
Most dialog plugins/scripts available today (lightbox, thickbox,
facebox, etc..) will size themselves to the content that they are
displaying. For some reason (to which I havent been able to find an
answer) the opposite path was chosen for the Dialog widget in jQ.ui.
Please take the following example;
html
<fieldset id="dialogTarget">
<div>...</div>
</fieldset>
css
fieldset { min-width: 400px; }
fieldset div { width: 440px; }
script
$('#dialogTarget').dialog();
In this example, the dialog will be shown with all of it's default
attributes. However, the widget is hardcoded to use 300px; on the main
encapsulating div (ui-dialog) as an inline element style property if
no width is specified in the options. This inline style overrides the
default css value set in whatever theme css you may be using, thus
rendering width settings useless. Similarily, height is set to auto,
again inline.
When I removed the code which added height: auto; width: 300px; from
the inline style, and had overridden the .ui-dialog { width: 300px; }
property and set it to auto, the dialog behaved exactly as I expected;
it sized itself to the content which I was directing it to build
around.
So the question for Dialog.a now becomes; Why wasn't this path chosen
before? And why did the developers choose to hardcode the width,
opting for inline style properties?
Lastly, I would like to know how open the jQuery.UI team is to
contributions. I have completed modifications for these suggestions,
with the exception of Datepicker.b, and would be thrilled to see them
added into the codebase. It would be a real drag to have to re-patch
each new build of jq.ui. Please do respond with your comments/
questions about my proposed changes and/or contributing to the
project.
Thanks very much,
Andrew