Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping something from being dragged over #63

Open
tm0054 opened this issue Jul 26, 2013 · 2 comments
Open

Stopping something from being dragged over #63

tm0054 opened this issue Jul 26, 2013 · 2 comments

Comments

@tm0054
Copy link

tm0054 commented Jul 26, 2013

HI,

Sorry I already wrote this in a response to my message in the closed messages area. I'm a jquery newb so I know this is pretty basic stuff. Anyhow:

I'm combining a few things to attempt to get the results I am looking for . In some events I want the first object to always occupy the first spot. I don't want it to be able to be dragged or dragged over. In your docs I found a few commands that in description sound like they might help me achieve that goal:

            $(".container").shapeshift({
                handle: '.dragger',
                dragWhitelist: '.draggable',
                cutoffStart: 2
            });

This is the code I am using. The 'dragWhiteList' command works great. You can't drag the first item as it's not set to draggable.

cutoffStart sounds like what I would need in order to stop things from dragging over the first item, but I'm not sure if I am using it correctly. Anyhow, what I have there isn't stopping anything from dragging over the first item

@AshesOfOwls
Copy link
Owner

This kind of functionality was kind of a tack on rather than a feature I planned out (actually most of the plugin feels that way now heh). The cutoffstart is definitely what I think you are looking for but honestly I'm not sure if I tested it well enough.

This is my first public plugin so I haven't really developed a personal system to maintain it. I am currently working on version 3.0 though which is intended to be a much more polished 2.0, in which I will test out these features more. In order to spend more time on making 3.0 the best I can I have decided to abandon maintaining 2.0 and I'll add this feature to my 3.0 todo list and get back to you when I push it up to the branch.

@appcuarium
Copy link

Hi,

To enable this behavior:

  1. Under Plugin.prototype.setTargetPosition, line 515, set target_position variable to
    target_position = ( options.cutoffStart !== undefined && options.cutoffStart == 0 ) ? 1 : 0;
  2. Pass cutoffStart as option with value of 0
    $container.shapeshift({ cutoffStart: 0 });
    

You're good to go.
Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants