apostrophe-schemas
Advanced tools
Comparing version 0.1.8 to 0.1.9
{ | ||
"name": "apostrophe-schemas", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Schemas for easy editing of properties in Apostrophe objects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -423,2 +423,18 @@ function AposSchemas() { | ||
}; | ||
// A convenience allowing you to scroll to the first error after | ||
// convertFields reports an error. Not called automatically. | ||
self.scrollToError = function($el) { | ||
var $element = $el.find('.apos-error'); | ||
if (!$element.length) { | ||
return; | ||
} | ||
var offset = $element.offset(); | ||
var scrollTop = offset.top - 100; | ||
$('html, body').scrollTop(scrollTop); | ||
var $input = $element.find('input'); | ||
if ($input.length) { | ||
$input.focus(); | ||
} | ||
}; | ||
} | ||
@@ -425,0 +441,0 @@ |
@@ -125,4 +125,8 @@ # apostrophe-schemas | ||
The field in question must not be empty. | ||
If `schemas.convertFields` does pass an error, you may invoke: | ||
`aposSchemas.scrollToError($el)` | ||
To ensure that the first error in the form is visible. Errors are indicated by the presence of the `apos-error` class on the fieldset for a particular element, which you may apply yourself if doing custom validation independent of `convertFields`. | ||
#### Preventing Autocomplete | ||
@@ -129,0 +133,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70299
880
775