New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swipe-to-delete

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swipe-to-delete - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

5

changelog.md

@@ -0,2 +1,5 @@

### v0.1.4
* First version.
### v0.1.0
* Initial version.
* Initial version.

2

package.json
{
"name": "swipe-to-delete",
"version": "0.1.3",
"version": "0.1.4",
"description": "Implement the 'swipe to delete' UI-pattern in the Marionette framework.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/gaer87/swipe-to-delete",

@@ -5,3 +5,3 @@ # Swipe-to-delete Marionette View

## Example
You may see an example here http://gaer87.github.io/swipe-to-delete/example/.
You may see an example [here](http://gaer87.github.io/swipe-to-delete/example/).

@@ -24,14 +24,34 @@ ## Usage

- "childView" contains the swipe-to-delete Marionette view.
- "childViewOptions" returns options for the swipe-to-delete view.
- *childView* contains the swipe-to-delete Marionette view.
- *childViewOptions* returns its options.
### Include lib
It's available on *SwipeToDeleteView*.**default**.
#### CommonJS
```
var SwipeToDeleteView = require('swipe-to-delete');
// SwipeToDeleteView.default
```
#### AMD
```
define(['swipe-to-delete'], function(SwipeToDeleteView) {
// SwipeToDeleteView.default
});
```
#### Global
```
<script src="node_modules/swipe-to-delete/dist/swipe-to-delete.min.js"></script>
<script>
// SwipeToDeleteView.default
</script>
```
### Options
- "View" - This must be your a view object definition, not an instance. It can be any Backbone.View or be derived from Marionette.ItemView. Required.
- "DeleteView" - This is a decoration view object definition under a content view. By default, showed red element with trash icons. Optional.
- "deleteSwipe" - This is a number. If a content view is swiped more this the number than a swipe-to-delete view will start a delete animation. By default, it's equal "0.5". Optional.
- **View** - This must be your a view object definition, not an instance. It can be any Backbone.View or be derived from Marionette.ItemView. *Required*.
- **DeleteView** - This is a decoration view object definition under a content view. By default, showed red element with trash icons. *Optional*.
- **deleteSwipe** - This is a number. If a content view is swiped more this the number than a swipe-to-delete view will start a delete animation. By default, it's equal "0.5". *Optional*.
### Events
The swipe-to-delete view triggers following events on a content view:
- "swipe:delete" - when a delete animation is ended. It's used to destroy entity.
- **swipe:delete** - when a delete animation is ended. It's used to destroy entity.
```

@@ -42,24 +62,9 @@ onSwipeDelete: function () {

```
- **swipe:cancel** - when a cancel animation is ended.
- "swipe:cancel" - when a cancel animation is ended.
### Styles
You may set up styles in "swipe-to-delete.css" under the comment "Custom styles". Classes "js-transition-delete-right" and "js-transition-delete-left" are added on a content view when it's swiped more than "deleteSwipe" options. Class "js-transition-cancel" is added when a content view swiped less than "deleteSwipe" options. Animations are made by CSS3 transition.
You may set up styles in "swipe-to-delete.css" under the comment "Custom styles". The class *js-content* is content region, *js-delete* is delete region. Classes *js-transition-delete-right* and *js-transition-delete-left* are added on a content view when it's swiped more than "deleteSwipe" options. Class *js-transition-cancel* is added when a content view swiped less than "deleteSwipe" options. Animations are made by CSS3 transition.
### Include
#### CommonJS
#### AMD
```
define(['jquery', 'backbone', 'backbone.marionette', 'swipe-to-delete'], function ($, Backbone, Marionette, SwipeToDeleteView) {
});
```
#### Global
```
<script src="node_modules/swipe-to-delete/dist/swipe-to-delete.min.js"></script>
```
It's available on *SwipeToDeleteView.default*.
## Downloads
You can download the latest builds directly from the "dist" folder above. Swipe-to-delete is available via bower and npm.
Swipe-to-delete is available via [bower](http://bower.io) and [npm](https://www.npmjs.com/). Else you can download the latest builds directly from the "dist" folder above.

@@ -66,0 +71,0 @@ ## Contributing

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc