Skip to content

Disable ESC key option #66

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

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
node_modules/
test/unit/coverage/
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
language: node_js
node_js:
- "node"
node_js:
- 8
cache:
directories:
- node_modules
script:
- npm run test
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![npm version](https://badge.fury.io/js/vuejs-dialog.svg)](https://badge.fury.io/js/vuejs-dialog)
[![Build Status](https://travis-ci.org/Godofbrowser/vuejs-dialog.svg?branch=master)](https://travis-ci.org/Godofbrowser/vuejs-dialog)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/Godofbrowser/vuejs-dialog.svg?branch=master)](https://scrutinizer-ci.com/g/Godofbrowser/vuejs-dialog/?branch=master)
[![npm](https://img.shields.io/npm/dt/vuejs-dialog.svg)]()
[![npm](https://img.shields.io/npm/dt/vuejs-dialog.svg)](https://github.com/Godofbrowser/vuejs-dialog/archive/master.zip)

![Vuejs Dialog Plugin](./src/docs/img/html-enabled.png?raw=true 'Vuejs Dialog Plugin example')
![Vuejs Dialog Plugin](./src/docs/img/demo.gif?raw=true 'Vuejs Dialog Plugin usage demo')
Expand Down Expand Up @@ -64,7 +64,7 @@ yarn add vuejs-dialog
// import into project
import Vue from 'vue';
import VuejsDialog from 'vuejs-dialog';
import VuejsDialogMixin from 'vuejs-dialog/vuejs-dialog-mixin.min.js'; // only needed in custom components
import VuejsDialogMixin from 'vuejs-dialog/dist/vuejs-dialog-mixin.min.js'; // only needed in custom components

// include the default style
import 'vuejs-dialog/dist/vuejs-dialog.min.css';
Expand Down Expand Up @@ -169,13 +169,36 @@ Vue.dialog
>

okCallback: function (dialog) {
dialog.loaging(false) // stop the loader (you won't be needing this)
dialog.loading(false) // stop the loader (you won't be needing this)
dialog.close() // stops loader and close the dialog
dialog.node.className // === "btn-danger"
dialog.data // === null
}
```

## Prompt (collect data from user)

```javascript
this.$dialog
.prompt({
title: "Let's hear from you",
body: "What is the most important thing in life?",
}, {
promptHelp: 'Type in the box below and click "[+:okText]"'
})
.then(dialog => {
// Triggered when proceed button is clicked
// Show an alert with the user's input as the message
this.$dialog.alert(dialog.data || '[empty]')
})
.catch(() => {
// Triggered when dialog is dismissed by user

console.log('Prompt dismissed');
});
```


## Usage with ajax - Loader enabled

```javascript
Expand Down Expand Up @@ -336,7 +359,7 @@ let options = {
verification: 'continue', // for hard confirm, user will be prompted to type this to enable the proceed button
verificationHelp: 'Type "[+:verification]" below to confirm', // Verification help text. [+:verification] will be matched with 'options.verification' (i.e 'Type "continue" below to confirm')
clicksCount: 3, // for soft confirm, user will be asked to click on "proceed" btn 3 times before actually proceeding
backdropClose: false // set to true to close the dialog when clicking outside of the dialog window, i.e. click landing on the mask
backdropClose: false, // set to true to close the dialog when clicking outside of the dialog window, i.e. click landing on the mask
customClass: '' // Custom class to be injected into the parent node for the current dialog instance
};

Expand Down
2 changes: 1 addition & 1 deletion dist/vuejs-dialog-mixin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vuejs-dialog.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
ga('create', 'UA-105766420-1', 'auto');
ga('send', 'pageview');
</script>
<link href="css/app.main.css?6674f9de4f06722b31c8" rel="stylesheet"></head>
<link href="css/app.main.css?eeacbef99df2fcfc3845" rel="stylesheet"></head>
<body>
<div id="app"></div>
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
<script type="text/javascript" src="js/app.main.js?6674f9de4f06722b31c8"></script></body>
<script type="text/javascript" src="js/app.main.js?eeacbef99df2fcfc3845"></script></body>
</html>
2 changes: 1 addition & 1 deletion docs/js/app.main.js

Large diffs are not rendered by default.

Loading