| 9 | | if (!!options && options.constructor == String) { |
| 10 | | var method = options; |
| 11 | | var dialog = $.data(this, "ui-dialog"); |
| 12 | | if (!dialog) { |
| 13 | | dialog = $.data($(this).parents(".ui-dialog:first").find(".ui-dialog-content")[0], "ui-dialog"); |
| 14 | | } |
| 15 | | dialog[method].apply(dialog, data); |
| 16 | | } else { |
| 17 | | if (!$(this).is(".ui-dialog-content")) { |
| 18 | | // INIT with optional options |
| 19 | | new $.ui.dialog(this, options); |
| 20 | | } |
| 21 | | } |
| | 9 | if (typeof options == "string") { |
| | 10 | var dialog = $.data(this, "ui-dialog") || |
| | 11 | $.data($(this).parents(".ui-dialog:first").find(".ui-dialog-content")[0], "ui-dialog"); |
| | 12 | dialog[options].apply(dialog, Array.prototype.slice.apply(arguments, 1)); |
| | 13 | |
| | 14 | // INIT with optional options |
| | 15 | } else if (!$(this).is(".ui-dialog-content")) |
| | 16 | new $.ui.dialog(this, options); |