Opened 13 years ago
Closed 13 years ago
#6891 closed feature (fixed)
Widget: Improve API for direct instantiation
Reported by: | Scott González | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.widget | Version: | 1.8.8 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When instantiating a widget directly (new $.ui.dialog( options, element )
), the following should be improved:
- The new keyword should be optional
- When not using the new keyword, the widget should be initialized even if called with no parameters
- When called with the new keyword, the widget should not be initialized to allow the simple inheritance pattern to continue to work
- The widget should be able to generate an element if one is not provided
- Providing a selector or jQuery object instead of a DOMElement should fully work
- Currently the widget will be instantiated and
this.element
will be correct, but the instance will not be stored as data on the element
- Currently the widget will be instantiated and
Note: See
TracTickets for help on using
tickets.
Implemented in 3a0b617bb44565aacfa90c2ee20b293654d911c9 and 244eebe74dbc7bb35141e58e52ef9eaa21bd35f1.
Tests added in bc71499a505d0932668b4ae75603cd9dbfd4a2ac.
Proper default elements for all widgets in 29bfb86ce2e192dae456bf15655c25cb469ad977.