jquery/jquery-ui — pull request #510 by Akkuma (2011-10-31 17:24:59+00:00)
Title: Dialog http://bugs.jqueryui.com/ticket/5388

Dialog: Modified how finding the max z-index was done, should improve performance as well. Prevented dialogs from infinitely increasing z-index. Fixed #5388 - Dialog: Don't change z-index when already at the top

Originally dialog looked for all dialogs through the css class. Rather than take that performance hit, I'm just storing the instance of the dialog created in a tracking object, based on the titleId. From this collection we can easily determine the maximum z-index that should be applied to any dialog.