javascript - Does the order of jQueryUI Dialogs make a difference (maybe just with TinyMCE)? -
in script below (live example located @ http://jsbin.com/aliket/1/ source code located @ http://jsbin.com/aliket/1/edit), created 2 dialogs, 1 (#dialog2) child within other (#dialog1). if create #dialog2 before #dialog1, open #dialog1 , open #dialog2, tinymce plugin no longer works. not working, mean tinymce's text box shaded out , entered html gone. problem order of 2 dialogs, or tinymce? why happening? know how fix it,however: create #dialog1 before #dialog2. thanks
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>testing</title> <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script> <script src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script> </head> <body> <button id="click1">click 1</button> <div id="dialog1" title="dialog1"><div id="tinymce"></div><button id="click2">click 2</button></div> <div id="dialog2" title="dialog2">hello</div> </body> <script> tinymce.init({selector: "#tinymce"}); $(function() { $('#click2').click(function(){$("#dialog2").dialog("open");}); $("#dialog2").dialog({autoopen:false,resizable:false,height:300,width:240,modal:true}); $("#click1").click(function(){$("#dialog1").dialog("open");}); $("#dialog1").dialog({autoopen: false,modal: true}); }); </script> </html>
i think problem here did not shut down editor instance before opened 1 same id. use mcecommand mceremovecontrol
shut such editor instance down.
Comments
Post a Comment