Tristan,
If I change
new Draggable(element);
to
new Draggable(‘drag_5’);
it works for me.
When doing an alert(element.toSource()) I get
({element:{}, content:”<div id="drag_5"
class="blurb">Inserted test drag</div>”, range:{}})
So it looks like this use of Inserstion.Top() returns a text
node or a hash.
Ken
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tristan
Kelley
Sent: Monday, June 12, 2006 8:55 AM
To: [email protected]
Subject: Re: [Rails-spinoffs] Re: Making an Insertion.After element a
Sortable
Here the basic layout/function
of my page. The Insertion is still not draggable but if I use Builder.node it
is. Thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<style type="text/css" media="screen">
@import url(css/style.css);
</style>
<script src=""
type="text/_javascript_"></script>
<script src=""
type="text/_javascript_"></script>
</head>
<body >
<script type="text/_javascript_">
function newtest() {
Sortable.destroy('left_column');
element = new Insertion.Top('left_column', '<div
id="drag_5" class="blurb">Inserted test
drag</div>');
new Draggable(element);
startDragging();
}
</script>
<a style="cursor:pointer ">
Add a new paragraph
</a>
<div id="left_column" class="section">
<div id="drag_1"
class="blurb">Drag test 1</div>
<div id="drag_2" class="blurb">Drag
test 2</div>
</div><!-- end left column -->
<div id="right_column" class="section1">
<div id="drag_3"
class="blurb">Drag test 3</div>
<div id="drag_4"
class="blurb">Drag test 4</div>
</div><!-- end right column -->
<script type="text/_javascript_">
function startDragging() {
// <![CDATA[
sections = ['left_column','right_column'];
Sortable.create ('left_column',{tag:'div',dropOnEmpty: true,
containment: sections,constraint:false,only:'blurb'});
Sortable.create('right_column',{tag:'div',dropOnEmpty: true,
containment: sections,constraint:false,only:'blurb'});
// ]]>
}
</script>
</body>
</html>
Date: Jun 9, 2006 4:30 PM
Subject:
RE: [Rails-spinoffs] Re: Making an Insertion.After element a Sortable
Hmm, you may need
Insertion.Bottom() instead of After. The after will be out of the
'left_column' container.