clocklimited / cf-form-cancel-delegate

Show a confirmation dialog if model changes will be lost when navigating from a form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@clocklimited/cf-form-cancel-delegate

Show a confirmation dialog if model changes will be lost when navigating from a form

WARNING

From 4.0.0 your project will require at least schemata@8

Installation

npm install --save @clocklimited/cf-form-cancel-delegate

Usage

On a Backbone view that has an initialModel property:

var formCancelDelegate = require('cf-form-cancel-delegate')(logger)
formCancelDelegate.call(view) // Needs to be executed in the context of the view

Example:

Example

Credits

Built by developers at Clock.

Licence

Licensed under the New BSD License

About

Show a confirmation dialog if model changes will be lost when navigating from a form

License:MIT License


Languages

Language:JavaScript 100.0%