Using the CSS class names seem fairly reasonable, if imperfact. One could
make (in fact I would make) quite a strong argument that they are in fact
part of our public API. In this particular use, the example you show
(dialog) points out one of few gotchas. The element on which you call
.dialog gets a class of ui-dialog-content and gets wrapped by a ui-dialog
element. This is a bit of an exception, as the norm is for the class
'ui-{pluginname}' to be added to the same element on which
.{pluginname}([options]) is called.That said, I don't know that there is a way currently to check (via pluginname, reliably) whether a plugin has been initialized on an element. You could enter a feature request ticket for this here: http://dev.jqueryui.com/newticket (note: requires registration) - Richard On Sun, Mar 1, 2009 at 11:02 AM, Keith <[email protected]> wrote: > > Seems like this is an easy one, but I'm not having luck. > > Currently I do this. > > if( ! $("#widget-id").hasClass("ui-dialog-content") ) { > > // setup dialog and do other expensive stuff > > } > > But of course that depends on the CSS class names used. Is there a > better way, using only the public API? > > Thanks. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
