Merge pull request #12 from rschroll/prompt

Avoid shadowing the global prompt function
This commit is contained in:
chg20 2020-05-16 14:10:10 -07:00 committed by GitHub
commit 2f21351f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 10 deletions

View File

@ -4,10 +4,6 @@
* Support IE11 (stretch: IE10)
* < 6k in .min.gz form
## Launch TODOS
* Move to development branch
## Post-Launch TODOS
* Clean up event naming

View File

@ -1111,8 +1111,8 @@ var kutty = kutty || (function () {
}
var promptQuestion = getClosestAttributeValue(elt, "kt-prompt");
if (promptQuestion) {
var prompt = prompt(promptQuestion);
if(!triggerEvent(elt, 'prompt.kutty', {prompt: prompt, target:target})) return endRequestLock();
var promptResponse = prompt(promptQuestion);
if(!triggerEvent(elt, 'prompt.kutty', {prompt: promptResponse, target:target})) return endRequestLock();
}
var confirmQuestion = getClosestAttributeValue(elt, "kt-confirm");
@ -1122,7 +1122,7 @@ var kutty = kutty || (function () {
var xhr = new XMLHttpRequest();
var headers = getHeaders(elt, target, prompt, eventTarget);
var headers = getHeaders(elt, target, promptResponse, eventTarget);
var rawParameters = getInputValues(elt, verb);
var filteredParameters = filterValues(rawParameters, elt, verb);

View File

@ -351,7 +351,7 @@ will be included.
If you wish to include the values of other elements, you can use the [kt-include](/attributes/kt-include) attribute
with a CSS selector of all the elements whose values you want to include in the request.
If you wish to filter out some parameters you can use the [kt-parameters](/attributes/kt-parameters) attribute.
If you wish to filter out some parameters you can use the [kt-params](/attributes/kt-params) attribute.
Finally, if you want to programatically modify the parameters, you can use the [configRequest.kutty](/events#configRequest.kutty)
event.

View File

@ -15,7 +15,7 @@ You can copy and paste them and then adjust them for your needs.
| [Bulk Update](/examples/bulk-update) | Demonstrates bulk updating of multiple rows of data
| [Click To Load](/examples/click-to-load) | Demonstrates clicking to load more rows in a table
| [Lazy Loading](/examples/lazy-load) | Demonstrates how to lazy load content
| [Inline Validation](/examples/inline-validation) | Demonstrates how to lazy load content
| [Inline Validation](/examples/inline-validation) | Demonstrates how to do inline field validation
| [Infinite Scroll](/examples/infinite-scroll) | Demonstrates infinite scrolling of a page
| [Active Search](/examples/active-search) | Demonstrates the active search box pattern
| [Progress Bar](/examples/progress-bar) | Demonstrates a job-runner like progress bar

View File

@ -11,7 +11,8 @@ and updates the DOM with the validation results.
We start with this form:
```html
<h3>Signup Form</h3><form ic-post-to="/contact">
<h3>Signup Form</h3>
<form kt-post="/contact">
<div kt-target="this" kt-swap="outerHTML">
<label>Email Address</label>
<input name="email" kt-post="/contact/email" kt-indicator="#ind">