Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kellyselden/ember-cli-dirty-confirm
A dirty model route transition aborter
https://github.com/kellyselden/ember-cli-dirty-confirm
Last synced: 16 days ago
JSON representation
A dirty model route transition aborter
- Host: GitHub
- URL: https://github.com/kellyselden/ember-cli-dirty-confirm
- Owner: kellyselden
- License: mit
- Created: 2015-01-30T18:38:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-17T18:18:30.000Z (over 8 years ago)
- Last Synced: 2024-12-26T03:32:11.300Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 48.8 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
#ember-cli-dirty-confirm
[![npm version](https://badge.fury.io/js/ember-cli-dirty-confirm.svg)](https://badge.fury.io/js/ember-cli-dirty-confirm)
[![Build Status](https://travis-ci.org/kellyselden/ember-cli-dirty-confirm.svg)](https://travis-ci.org/kellyselden/ember-cli-dirty-confirm)
[![Code Climate](https://codeclimate.com/github/kellyselden/ember-cli-dirty-confirm/badges/gpa.svg)](https://codeclimate.com/github/kellyselden/ember-cli-dirty-confirm)A dirty model route transition aborter. It will show a confirm dialog giving you a chance to cancel a route change. If you agree, it will rollback your model.
##Usage
```
ember install ember-cli-dirty-confirm
``````js
import DirtyConfirmRouteMixin from 'ember-cli-dirty-confirm/mixins/dirty-confirm-route';export default Ember.Route.extend(DirtyConfirmRouteMixin, {
// optional, the default message is "Leaving this page will lose your changes. Are you sure?"
dirtyMessage: "Please don't go!",
// optional, temporarily disable the message
isDirtyConfirmEnabled: false
});
```It also exposes an action called `toggleDirtyConfirm`, so you can toggle off from outside the route.