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

Allow for an optional drag handle to be specified #59

Closed
wants to merge 1 commit into from
Closed

Allow for an optional drag handle to be specified #59

wants to merge 1 commit into from

Conversation

manavo
Copy link
Contributor

@manavo manavo commented Oct 9, 2012

When defining the gridster, you can now define a draggable.handle selector:

For example:

    $("#widgets").gridster({
        widget_margins: [10, 10],
        widget_base_dimensions: [140, 140],
        draggable: {
            handle: '.title'
        }
    });

If handle is omitted (or left blank), it works as it did previously. If a value is specified, then dragging only starts if the element which was clicked matches the selector specified.

When defining the gridster, you can now define a draggable.handle selector:

For example:

    $("#widgets").gridster({
        widget_margins: [10, 10],
        widget_base_dimensions: [565, 400],
		draggable: {
			stop: function(event, ui) {
				console.log('save new columns');
			},
			handle: '.title'
		}
    });

If handle is omitted (or left blank), it works as it did previously. If a value is specified, then dragging only starts if the element which was clicked matches the selector specified.
@vieron
Copy link
Member

vieron commented Oct 19, 2012

Thanks for the PR @manavo!

I made the code a bit shorter and now draggable.handle supports both selectors as strings and DOM objects.

You can see it merged with master here 552df22

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

Successfully merging this pull request may close these issues.

None yet

2 participants