dialogue shows only first time
Hi guys,
I use JQUI .1.7.2 , without resizable, dragable, etc ... I want to
have a thin layer on top of it mainly to have simple message boxes ,
with html markup created dynamically ...
So. All was working fine until I switched to the latest version.
dialogue pops-up only first time. second, third, etc.. nothing
happens, no erros etc ... And this is in every browser L IE8, FF3.5
and CH ...
The core of my micro-framework is the function bellow :
///<summary>
//Common implementation
//(hidden in the closure)
///</summary>
function DBJ_DLG(opts) {
this.div_id = DBJ_DLG.uid("dbj_dlg_div");
var $dlg = null, nullfun = function() { };
///<summary>
///pop-up a dialogue
///options format:
// {h:600, w:800, title:"string", onclose:function(){},
onopen:function(){}}
///</summary>
this.show = function(options) {
// if ($dlg.css("display") != "block") { $dlg.css
("display", "block"); }
$dlg.dialog(
{
title: options.title || "DBJ*DialogueFrame",
height: options.h || 600,
width: options.w || 800,
position: 'centre',
// N/A: resizable: true,
modal: true,
overlay: { opacity: 0.4, background: '#000' },
buttons: { "Close": function()
{ options.onclose($dlg) || nullfun(); $(this).dialog('close'); } }
}
) ;
//
$dlg.ready(
function() { options.onopen($dlg) || nullfun(); }
);
}
// constructor code
// make elements for this dialog only once
$dlg = $("#" + this.div_id); // hold it
if ($dlg.length == 0) {
$("body").append(
'<div id="' + this.div_id + '" class="ui-dialog ui-draggable"
style="padding:0;display:none;"></div>'
);
$dlg = $("#" + this.div_id); // re-select
$dlg.html(opts.html || "");
}
}
DBJ_DLG.uid = function(base) { return base ? base + (+new Date
()) : (+new Date()); }
I never spent a lot of time in and arround jqUI , I am sure someone
will spot something obviously wrong in here ?
Regards; DBJ