hdeng-bootstrap
Advanced tools
Comparing version 2.7.1 to 2.7.2
@@ -11,2 +11,18 @@ module.exports = form; | ||
function scrollIntoViewIfNeeded(el) { | ||
if (el.scrollIntoViewIfNeeded) { | ||
el.scrollIntoViewIfNeeded(); | ||
return true; | ||
} | ||
if (el.scrollIntoView) { | ||
el.scrollIntoView(); | ||
return true; | ||
} | ||
return false; | ||
} | ||
function form(formFactory, config, values, initialState) { | ||
@@ -30,3 +46,3 @@ return React.createClass({ | ||
$(ReactDOM.findDOMNode(this)).each(function() { | ||
this.scrollIntoView && this.scrollIntoView(); | ||
scrollIntoViewIfNeeded(this); | ||
}); | ||
@@ -38,4 +54,5 @@ } else { | ||
el.find('[name="' + value + '"]:input, [name$="[' + value + ']"]:input').first().each(function() { | ||
this.scrollIntoView && this.scrollIntoView(); | ||
this.focus(); | ||
if (!scrollIntoViewIfNeeded(this)) { | ||
this.focus(); | ||
} | ||
}); | ||
@@ -60,4 +77,5 @@ return false; | ||
$(formGroupElement).each(function() { | ||
this.scrollIntoView && this.scrollIntoView(); | ||
$(this).find(':input').focus(); | ||
if (!scrollIntoViewIfNeeded(this)) { | ||
$(this).find(':input').focus(); | ||
} | ||
}); | ||
@@ -64,0 +82,0 @@ |
{ | ||
"name": "hdeng-bootstrap", | ||
"description": "Bootstrap your Heidelberg Engineering projects with ease.", | ||
"version": "2.7.1", | ||
"version": "2.7.2", | ||
"author": "Dots United GmbH", | ||
@@ -6,0 +6,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
1181259
483