Socket
Socket
Sign inDemoInstall

ng-drag-to-reorder

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.7 to 1.0.0

20

bower.json
{
"name": "ng-drag-to-reorder",
"version": "0.1.6",
"description": "Lightweight AngularJS drag and drop functionality to reorder lists without any dependencies other than Angular.",
"main": "./ngDragToReorder.js",
"version": "1.0.0",
"description": "Lightweight AngularJS directive for reordering any collection of elements using the HTML5 drag and drop API without any dependencies other than Angular. No jQuery!",
"homepage": "https://github.com/mhthompson86/ng-drag-to-reorder",
"authors": [

@@ -13,8 +14,14 @@ "MacGregor Thompson <mhthompson86@gmail.com>"

"Angular",
"Drag and drop",
"drag",
"and",
"drop",
"Draggable",
"Reorder",
"ng-repeat"
"ng-repeat",
"html5",
"lists",
"sortable",
"dnd",
"ng"
],
"homepage": "https://github.com/mhthompson86/ng-drag-to-reorder",
"ignore": [

@@ -26,4 +33,5 @@ "**/.*",

"tests",
"demo/*"
"*.json",
"demo"
]
}
{
"name": "ng-drag-to-reorder",
"version": "0.1.7",
"version": "1.0.0",
"description": "Lightweight AngularJS drag and drop functionality to reorder lists without any dependencies other than Angular.",

@@ -5,0 +5,0 @@ "main": "ngDragToReorder.js",

@@ -36,3 +36,3 @@ # ng-drag-to-reorder

**1) Listening for the dropped event and then doing something with the newly reordered collection.**
### 1) Listening for the dropped event and then doing something with the newly reordered collection.
- Add the `drag-to-reorder` attribute to the parent element and pass it the collection you want it to track.

@@ -72,3 +72,3 @@ Then on the draggable elements, add the `dtr-draggable` attribute.

**2) Using 2-way data binding to directly update the collection that is being passed in.**
### 2) Using 2-way data binding to directly update the collection that is being passed in.
- Add the `drag-to-reorder-bind` attribute to the parent element and pass it the collection you want it to track.

@@ -116,4 +116,7 @@ Then on the draggable elements, add the `dtr-draggable` attribute. That's it! This is great if all you need to know is the index

1. `dtr-init` allows you turn the drag and drop functionality on and off. You can pass it an expression to observe and will add or remove the event listeners based on a true/false value.
### 1) dtrInit
- The `dtr-init` attribute allows you turn the drag and drop functionality on and off. You can pass it an expression to observe and will add or remove the event listeners based on a true/false value.
(Note that this is the only attribute that requires interpolation.)
```html

@@ -141,4 +144,6 @@ <!-- In your template (example) -->

```
<br>
2. `dtr-transition-timeout` allows you to set the timeout period (in milliseconds) for when the `dtr-transition` class is removed from the dragged element.
### 2) dtrTransitionTimeout
- The `dtr-transition-timeout` attribute allows you to set the timeout period (in milliseconds) for when the `dtr-transition` class is removed from the dragged element.
You can pass in the number of milliseconds, or you can pass in a variable for it to evaluate.

@@ -159,5 +164,6 @@ This is just an available option in case you want to add some custom animation.

```
<br>
3. You can import the **ngDragToReorder** service into your controller and check to see if drag and drop functionality is supported by your
### 3) The ngDragToReorder service
- The `ngDragToReorder` service can be imported into your controller to check to see if drag and drop functionality is supported by your
browser. The `dtr-draggable` directive uses this service to prevent itself from wiring up event listeners if the browser doesn't support

@@ -192,4 +198,6 @@ it. You can use the same service if you want to show or hide any buttons or other UI based on browser support.

```
<br>
4. `dtr-event` allows you to customize the name of the event broadcasted when an element is dropped.
### 4) dtrEvent
- The `dtr-event` attribute allows you to customize the name of the event broadcasted when an element is dropped.
This is particularly helpful if you have more than one collection and/or controller and want to make sure they only react to the event they are supposed to.

@@ -196,0 +204,0 @@ The name passed in will replace 'dropped' in 'dragToReorder.dropped'. See below for example.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc