function show_dialog(dialog, fromCode) {
var $dlg = $('div#' + dialog);
if (!is_defined(fromCode) || fromCode === null) {
fromCode = false;
} else if (fromCode) {
if ($dlg.length > 1) {
$dlg.each(function(i) {
if (i === 0) { i++; }
else { $(this).remove(); }
});
}
}
$dlg = $('div#' + dialog);
$dlg.dialog({
modal: true,
draggable: false,
resizable: false,
autoOpen: true,
open: function(type, data) {
$(this).parent().appendTo('form');
},
close: function(event, ui) {
$(this).dialog('destroy');
}
});
}
|