oulan / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

cancelDialog should unselect the dialog element #298

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think dialog should not be necessarily a form. The problem comes when try to 
implement a type="cancel" button.
A small fix:

line 313 iui.js
else if (link.getAttribute("type") == "cancel")
{
    cancelDialog(findParentByClassName(link, "dialog")); //Add this
    //cancelDialog(findParent(link, "form"));  uncomment this
}

line 633 iui.js
//add this function
function findParentByClassName(node, className)
{
    while(node && (node.className!==className))
        node = node.parentNode; 
    return node;
}  

Original issue reported on code.google.com by spana...@gmail.com on 13 Sep 2011 at 10:38