-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added drag support for jQueryUI. #17
Conversation
In the event we like this let me know and I will update the README as well with jQueryUI as an optional library. |
@@ -205,7 +258,7 @@ | |||
if (scope.isResizeBound === 'false') { scope.isResizeBound = false; } | |||
|
|||
// Set global draggability | |||
if (scope.draggable) { controller.setDraggable(scope.handle); } | |||
scope.draggable = (scope.draggable) ? controller.setDraggable(scope.draggable, scope.handle) : angular.noop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would this evaluate to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When draggable
is not an attribute the packery-object
I believe. Ill need to test that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I specifically meant scope.draggable = (scope.draggable)
. Wouldn't that always be true?
…ggable as attribute on packery element
REVISED :
|
draggable: true, | ||
handle: '*', | ||
draggable: undefined, | ||
handle: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove these before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing these declarations will create a need to revisit the link function in the packeryDirective.
scope.draggable = scope.draggable || config.draggable;
scope.handle = scope.handle || config.handle;
I added support for jQueryUI.
Conditionals check for
draggable
attribute on thepackery-object
to be set to 'draggabilly', 'jqueryui', or 'unsupported'If
draggable
is left undefined thewindow
is checked forDraggabilly
thenjQuery.ui
. If neither are present then no drag functionality is added.Console warnings let the user know if they are specifically requesting a library and the library is not present.
ie.
draggable='draggabilly'
and draggabilly.js is not included.fixes #16