Re: Issue with modalDialog in Firefox

  •  03-09-2009, 10:06 AM

    Re: Issue with modalDialog in Firefox

    Hi Adam,

    I'm opening the dialog with:

    WebControl ctrl = Editor1.CreateCommandButton("MyButton2", "Insert.gif", "Insert pic");
    ctrl.Attributes["onclick"] = "ShowMyDialog(this)";

    string picDialogScript = "function ShowMyDialog(button){\n\t//use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance\n";
    picDialogScript += "\tvar editor = CuteEditor_GetEditor(button);\n";
    picDialogScript += "\t//show the dialog page , and pass the editor as newwin.dialogArguments\n";
    picDialogScript += "\tvar newwin = showModalDialog(\"" + domain.ThisDomain + "/admin/MyPics.aspx?iseditor=true&_rand=\"+new Date().getTime(),editor,\"dialogWidth:760px;dialogHeight:500px\");\n}\n\n";

    ...

    function ShowMyDialog(button){
        var editor = CuteEditor_GetEditor(button);
        //show the dialog page , and pass the editor as newwin.dialogArguments
        var newwin = showModalDialog("/admin/MyPics.aspx?iseditor=true&_rand=\"+new  Date().getTime()",editor,"dialogWidth:790px;dialogHeight:500px;help:no;");
    }


    Then to send the image to the editor:

    function PasteHTML( picID )
    {
        var sCode = "<iframe style=\"border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px; width:10px; height:10px;\" src=\"/admin/PicOutput.aspx?picid=|" + picID + "|\" frameborder=\"0\" scrolling=\"no\"></iframe>";
        var editor = window.dialogArguments;
        editor.ExecCommand( "PasteHTML", false, sCode );
        window.close();
    }
     

    Thanks
View Complete Thread