Reputation: 1
I have one page which I want to have in it few instances of modal windows implemented by SimpleModal. The exact scenario is as follows:
Now, I've searched for an answer and I saw several posts of Eric Martin (the developer of SimpleModal) talking about having multiple modal windows. It seems like that SimpleModal doesn't support it, and what he recommends is the to replace the content of the modal with the new one.
What I'm trying to do is:
My problem is that when I try to run the last command it doesn't works. After investigating it seems like that the implementation of the SimpleModal plugin is keeping a flag if the modal() function was called on the certain element.
Just for general knowledge:
It seems like I'm faling on line 216 in the JS:
// don't allow multiple calls if (s.d.data) { return false; }
My code is the just after this section: I'm starting by running the logic of "jBtnNew_Click":
Admin.BL.SettingsPage.jBtnNew_Click=function(e)
{
Admin.BL.EcmSettings.ShowDialog("#getSubsidiariesForCustomer");
alert(""); //Just for debugging
Admin.BL.EcmSettings.ShowAlert();
}
Admin.BL.SettingsPage.ShowAlert=function()
{
var id = $("div.model:visible").eq(0).attr("id");
$("#alertBtnOk").one("click", function(e){
$.modal.close();
if (id != undefined)
{
Admin.BL.SettingsPage.ShowDialog(id);
}
}
);
Admin.BL.SettingsPage.ShowDialog("#alert");
}
Admin.BL.SettingsPage.ShowDialog=function(dialogId)
{
if (dialogId.indexOf("#") < 0)
{
dialogId = "#" + dialogId;
}
$("div.model").hide();
$("#dialog").modal({position:new Array("20%"),
overlayId:"dialog-overlay",
containerId:"confirm-container"});
$(dialogId).show();
}
And this is my HTML:
Get Customer's Subsidiaries Customer ID: Customer Name: This is my alert
Any help on solving this issue will be appreciated!!
Thanks :)
Upvotes: 0
Views: 1246
Reputation: 2841
I think your issue (#4) may be with the setTimeout
code I have in SimpleModal to deal with Opera issues. I need to remove it, but for now you can try editing the SimpleModal source by finding the following:
setTimeout(function(){
// opera work-around
s.d.overlay.remove();
// reset the dialog object
s.d = {};
}, 10);
And replacing it with:
s.d.overlay.remove();
// reset the dialog object
s.d = {};
Let me know if that does not work for you...
Upvotes: 2