Dec 142011
 

IMPORTANT: Please read this blog post before updating. The latest version, by default, breaks compatibility with previous versions!


I am happy to announce that dialogWrapper 2.1 has been released! Download/read about it at BitBucket: https://bitbucket.org/MostThingsWeb/dialogwrapper

 

What’s new?

The biggest change is that all methods are now namespaced! For example, instead of writing:

$.alert("This is an alert dialog!");

… by default you must now write:

$.dW.alert("This is an alert dialog!");

Why did I do this? Well, I was getting concerned about my polluting the global $ namespace. It should now be easier for my plugin to work with other plugins that may have used the same or similar function names.

 

But that breaks compatibility!?

You can use the new $.dW.classicMode() method to restore the old style functions. Just call it once, with no arguments. Then you can go back to using $.createDialog and friends instead of the new namespaced versions.

 

What else is new?

This version has a few new nice features:

  • The callbacks for $.dW.alert(), $.dW.confirm(), and $.dW.input() are now executed within the context of the dialog. That means that you can now use this within the handler to reference the dialog.
  • I added a callback to $.dW.alert() that is executed when the Ok button is clicked.
  • Options that dialogWrapper adds, with hasClose being the only one so far, are now defaulted in $.ui.dialog.prototype.options, along with native options. This way, you can easily modify the default hasClose setting.
  • You can now change the hasClose option at runtime using the usual method.
  • From this version forward, you can access the version string using $.dW.version.
  • I’ve exposed $.dW.findDialog, which is a utility method that attempts to resolve the given identifier to a dialog object.

 

And a couple of minor changes:
  • I’ve removed the smartModalsForClassicDialogs and smartModals options since they became redundant.
  • The default prefix for dialog IDs is now dWd instead of dwd.
  • A few bug fixes.
  • A couple of internal changes; if you are interested, read the full changelog in the source.
 Posted by at 4:06 pm

  3 Responses to “dialogWrapper 2.1 Released”

  1. Hello,
    I have been using normal jQuery UI modal dialogs on my page to display forms, with the form stored in HTML divs. However, after I added in the dialogWrapper for showing some confirmation/alert dialogs, the overlay now longer disappears when I close the other dialogs.

    The overlay works fine with the dW dialogs, but not with the ones I created.


    Thomas

Leave a Reply