add: curInst.restoreSelection(); 
context: 	ok: function(){		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();		var args = {};		args['rows'] = this["table_rows"].value;		args['cols'] = this["table_cols"].value;		args['caption'] = this["table_caption"].value;		args["tableattrs"] = "";		if(this["table_widthtype"].value == "percent"){			args["tableattrs"] += 'width="'+this["table_width"].value +'%" ';		}else{			args["tableattrs"] += 'width="'+this["table_width"].value +'px" ';		}		for(var i=0; i<this.editableAttributes.length; ++i){			var name = this.editableAttributes[i];			var value = this["table_"+name].value;			if(value.length > 0){				args["tableattrs"] += name + '="'+value+'" ';			}		}		if(!args["tableattrs"]){			args["tableattrs"] = "";		}		//show the border in IE by applying a custom class		if(dojo.render.html.ie && !this["table_border"].value){			args["tableattrs"] += 'class="dojoShowIETableBorders" ';		}		var html = "<table "+args["tableattrs"]+">";		if(args['caption']){			html += "<caption>"+args["caption"]+"</caption>";		}		var outertbody = "<tbody>";		if(this.tableNode){			//retain the content			var tbody = this.tableNode.getElementsByTagName("tbody")[0];			outertbody = tbody.outerHTML;			if(!outertbody){				var cnode = tbody.cloneNode(true);				var tmpnode = tbody.ownerDocument.createElement("div");				tmpnode.appendChild(cnode);				outertbody = tmpnode.innerHTML;			}			//TODO: save current selection and restore it later			dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.tableNode]);		}else{			var cols = "<tr>";			for (var i = 0; i < +args.cols; i++) { cols += "<td></td>"; }			cols += "</tr>";			for (var i = 0; i < args.rows; i++) { outertbody += cols; }			outertbody += "</tbody>";		}		html += outertbody+"</table>";		curInst.execCommand("inserthtml", html);		this.cancel();	}
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/InsertTableDialog.js/buggy/www/resources/dojo-ajax/src/widget/Editor2Plugin/InsertTableDialog.js