Commit 4948fad5 authored by Eugene Lazutkin's avatar Eugene Lazutkin

Added a try guard against some FF-related quirks. See the ticket for details....

Added a try guard against some FF-related quirks. See the ticket for details. Added a test for this kind of problem. Fixes #3370.

git-svn-id: http://svn.dojotoolkit.org/src/dojo/trunk@9402 560b804f-0ae3-0310-86f3-f6aa0a117693
parent fe5df7fc
......@@ -67,8 +67,13 @@ function(node, params){
// summary: event processor for onmouseover
// e: Event: mouse event
var n = e.relatedTarget;
for(; n; n = n.parentNode){
while(n){
if(n == this.node){ break; }
try{
n = n.parentNode;
}catch(x){
n = null;
}
}
if(!n){
this._changeState("Container", "Over");
......@@ -83,8 +88,13 @@ function(node, params){
onMouseOut: function(e){
// summary: event processor for onmouseout
// e: Event: mouse event
for(var n = e.relatedTarget; n; n = n.parentNode){
for(var n = e.relatedTarget; n;){
if(n == this.node){ return; }
try{
n = n.parentNode;
}catch(x){
n = null;
}
}
if(this.current){
this._removeItemClass(this.current, "Over");
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Dojo DnD form test</title>
<style type="text/css">
@import "../../resources/dojo.css";
@import "dndDefault.css";
body {
padding: 1em;
background:#ededed;
}
#container1,#container2 { width:300px; display:block; }
.clear { clear:both; }
</style>
<script type="text/javascript" src="../../dojo.js" djConfig="isDebug: true"></script>
<script type="text/javascript" src="../../dnd/container.js"></script>
<script type="text/javascript" src="../../dnd/selector.js"></script>
<script type="text/javascript" src="../../dnd/source.js"></script>
<script type="text/javascript" src="../../dnd/avatar.js"></script>
<script type="text/javascript" src="../../dnd/manager.js"></script>
<script type="text/javascript">
//dojo.require("dojo.dnd.source");
//dojo.require("dojo.dnd.manager");
var c1, c2;
function init(){
c1 = new dojo.dnd.Source("container1");
c1.insertNodes(false, [1, 2, 3, 4, 5, 6, [1, 2, 3], function(x){ return x + x; }]);
c2 = new dojo.dnd.Target("container2", {accept: ["money"]});
// example subscribe to events
dojo.subscribe("dndStart",function(foo){
console.debug(foo);
});
};
dojo.addOnLoad(init);
</script>
</head>
<body>
<h1 class="testTitle">Dojo DnD form test</h1>
<p>This is a test to confirm that the DnD container does not interfere with form elements.</p>
<div id="dragLists">
<div style="float:left; margin:5px; ">
<h3>Target 1</h3>
<p id="container1" class="container"></p>
</div>
<div style="float:left; margin:5px; ">
<h3>Target 2: form controls galore</h3>
<form id="container2" class="container" action="http://dojotoolkit.org">
Input text: <input type="text" /><br />
Input checkbox: <input type="checkbox" /><br />
Input radio: <input type="radio" /><br />
Input password: <input type="password" /><br />
Input file: <input type="file" /><br />
Input button: <input type="button" value="Button" /><br />
Input reset: <input type="reset" /><br />
Input submit: <input type="submit" /><br />
Input image: <input type="image" src="http://dojotoolkit.org/misc/feed.png" /><br />
Button: <button>Button</button><br />
Select: <select><option>Yes</option><option>No</option></select><br />
Textarea: <textarea cols="20" rows="3">Some text.</textarea>
</form>
</div>
<div class="clear"></div>
</div>
<p>HTML after</p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment