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

Added drag support for jQueryUI. #17

Closed
wants to merge 6 commits into from

Conversation

edmundquintero
Copy link
Collaborator

I added support for jQueryUI.

Conditionals check for draggable attribute on the packery-object to be set to 'draggabilly', 'jqueryui', or 'unsupported'

If draggable is left undefined the window is checked for Draggabilly then jQuery.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.

:godmode: fixes #16

@edmundquintero
Copy link
Collaborator Author

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();
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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?

@edmundquintero
Copy link
Collaborator Author

REVISED :

  • <packery> - No drag support
  • <packery draggable> - drag support. Checks for existing libraries (Draggabilly > jQueryUI). If neither library is found there is no drag functionality. No errors are thrown.
  • <packery draggable=''> - Same as above.
  • <packery draggable='draggabilly'> - drag supported. Checks for Draggabilly library specifically and throws an error if it is not found.
  • <packery draggable='jqueryui'> - Same as above.
  • <packery draggable='randomletters'> - Throws error because 'randomletters' is not a valid library.

draggable: true,
handle: '*',
draggable: undefined,
handle: undefined,
Copy link
Contributor

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.

Copy link
Collaborator Author

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;

@edmundquintero edmundquintero deleted the development2 branch March 9, 2016 19:02
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.

2 participants