Opened 12 years ago

Closed 12 years ago

#2492 closed defect (fixed)

Bug in creating savetextarea in RichText.js

Reported by: m.kaluzny@… Owned by: liucougar
Priority: blocker Milestone: 0.9
Component: Editor Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

Loading Editor2.js with dojo.require("Editor2.js") after loading the whole document and creating Editor2 results with an error:

Error: "dojo:editor2" widget object has no "create" method and does not appear to implement *Widget 

Here is simple test case for this bug:


<html>
<head>
<title>Editor2 test case</title>
<script type="text/javascript" src="js/dojo-200207/dojo.js"></script>
</head>
<body>
<button id="buildEditor">Build editor!</button>
<script type="text/javascript" >
dojo.event.connect(dojo.byId("buildEditor"), "onclick", function() {
	dojo.require("dojo.widget.Editor2");
	dojo.widget.createWidget("Editor2", {}, dojo.byId("editorContent"));
});
</script>
	<div id="editorContent">look ma! it's editable content!</div>
</body>
</html>

It seems that changing line:

savetextarea.style = "display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;";

to

with (savetextarea.style) {
	display="none";
	position="absolute";
	top="-100px";
	left="-100px";
	height="3px";
	width="3px";
	overflow="hidden";
}

at the top of RichText?.js fixes the problem.

Change History (3)

comment:1 Changed 12 years ago by liucougar

Milestone: 0.9
Owner: changed from bill to liucougar

comment:2 Changed 12 years ago by liucougar

Component: WidgetsEditor

comment:3 Changed 12 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [7421]) fixes #2492, added a test file for this makes sure before calling onLoad(), isClosed is set to false in richtext

Note: See TracTickets for help on using tickets.