adt-js-components 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adt-js-components",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "JavaScript components for Nette framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,18 +13,17 @@ function scrollToFirstError(form) {
13
13
 
14
14
  // we have to find first scrollable element (it can be document or modal for example)
15
15
  let scrollParent = Scrollparent(el);
16
+
16
17
  if (scrollParent.tagName === 'BODY') {
17
18
  scrollParent = document.scrollingElement || document.documentElement;
18
19
  }
19
20
 
20
- $(scrollParent).animate({
21
- scrollTop: el.getBoundingClientRect().top - el.offsetParent.getBoundingClientRect().top - 100
22
- }, 500);
21
+ scrollParent.scrollBy({top: el.getBoundingClientRect().top - 100, behavior: 'smooth'});
23
22
  }
24
23
 
25
24
  function run(options) {
26
25
  $.nette.ext('live').after(function($el) {
27
- $el.find('[data-app-submit-form]').find('input, textarea, select').on('input', function(e) {
26
+ $el.find('[data-adt-submit-form]').find('input, textarea, select').on('input', function(e) {
28
27
  this.classList.remove('is-invalid');
29
28
  if (isList(this)) {
30
29
  $(this).parent().parent().find('.is-invalid').removeClass('is-invalid');
@@ -63,7 +62,7 @@ function run(options) {
63
62
  } else {
64
63
  console.error('Package nette-forms is missing!');
65
64
  }
66
-
65
+
67
66
  $.nette.ext("submitForm", {
68
67
  before: function (xhr, settings) {
69
68
  if (settings.nette && settings.nette.form && settings.nette.form.attr('data-adt-submit-form') !== undefined) {