Ticket #6891 (closed feature: fixed)

Opened 2 years ago

Last modified 2 years ago

Widget: Improve API for direct instantiation

Reported by: scott.gonzalez Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.widget Version: 1.8.8
Keywords: Cc:
Blocking: Blocked by:

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

Change History

comment:1 Changed 2 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.