Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Temporary fix for issue 57 #59

Merged
merged 4 commits into from

3 participants

@McPants McPants merged commit e64fca7 into McPants:master
@dflatley

This temporary fix is good, but I'm having a problem with trying to pass events/eventhandlers along with cloned items with

$clone = $selected.clone(true, true).insertBefore($selected).addClass(clone_class);

If you try to the deep clone a draggable button (for example), and try to drag from one container to another, every time you drag the same item over to the second container you'll replace rather than add more instances of the same button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 4, 2013
  1. Added additional clone droppable area

    PangbornIdentity authored
  2. Setting first area as non droppable

    PangbornIdentity authored
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 4 deletions.
  1. +9 −3 core/jquery.shapeshift.js
  2. +4 −1 demos/clone.html
View
12 core/jquery.shapeshift.js
@@ -451,7 +451,9 @@
$clone.remove();
$("." + current_container_class).trigger("ss-rearrange");
} else {
- $clone.removeClass(clone_class);
+ $clone.removeClass(clone_class);
+ $original_container.shapeshift($original_container.data("plugin_shapeshift").options);
+ $current_container.shapeshift($current_container.data("plugin_shapeshift").options);
}
}
if ($original_container[0] === $current_container[0]) {
@@ -551,8 +553,12 @@
}
this.arrange(true);
if ($start_container[0] !== $selected.parent()[0]) {
- previous_container_class = options.previousContainerClass;
- return $("." + previous_container_class).trigger("ss-rearrange");
+ previous_container_class = options.previousContainerClass;
+ if ($("." + previous_container_class).data("plugin_shapeshift").options.enableCrossDrop == true) {
+ return $("." + previous_container_class).trigger("ss-rearrange");
+ } else {
+ return $("." + previous_container_class);
+ }
}
} else {
placeholder_class = this.options.placeholderClass;
View
5 demos/clone.html
@@ -39,7 +39,8 @@
<script>
$(document).ready(function() {
$(".clones").shapeshift({
- dragClone: true
+ dragClone: true,
+ enableCrossDrop: false
});
$(".droparea").shapeshift({
colWidth: 100
@@ -58,5 +59,7 @@
<div class="container droparea">
</div>
+ <div class="container droparea">
+ </div>
</body>
</html>
Something went wrong with that request. Please try again.