Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #59 from chrishumboldt/dev-rocket
Browse files Browse the repository at this point in the history
Small fix to valued check.
  • Loading branch information
chrishumboldt authored Jan 12, 2017
2 parents 099e540 + 926000a commit 10307c4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var RockMod_Form;
if (options.label.length > 0 && options.label !== 'normal') {
classes.push('_l-' + options.label);
}
if (typeof element.value === 'string' && element.value.length > 0) {
if (Rocket.exists(element) && Rocket.is.string(element.value) && element.value.length > 0) {
classes.push('_valued');
}
break;
Expand All @@ -92,7 +92,7 @@ var RockMod_Form;
if (options.label.length > 0 && options.label !== 'normal') {
classes.push('_l-' + options.label);
}
if (typeof element.value === 'string' && element.value.length > 0) {
if (Rocket.exists(element) && Rocket.is.string(element.value) && element.value.length > 0) {
classes.push('_valued');
}
}
Expand Down
4 changes: 2 additions & 2 deletions build/ts/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module RockMod_Form {
if (options.label.length > 0 && options.label !== 'normal') {
classes.push('_l-' + options.label);
}
if (typeof element.value === 'string' && element.value.length > 0) {
if (Rocket.exists(element) && Rocket.is.string(element.value) && element.value.length > 0) {
classes.push('_valued');
}
break;
Expand All @@ -109,7 +109,7 @@ module RockMod_Form {
if (options.label.length > 0 && options.label !== 'normal') {
classes.push('_l-' + options.label);
}
if (typeof element.value === 'string' && element.value.length > 0) {
if (Rocket.exists(element) && Rocket.is.string(element.value) && element.value.length > 0) {
classes.push('_valued');
}

Expand Down
1 change: 1 addition & 0 deletions build/ts/rocket-tools.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ declare namespace Rocket {

interface is {
object(check: any): boolean;
string(check: any): boolean;
touch(): boolean;
}
var is: is;
Expand Down
2 changes: 1 addition & 1 deletion js/form.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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rocket-form",
"version": "3.1.1",
"version": "3.1.2",
"description": "A universal form module.",
"main": "js/form.min.js",
"repository": {
Expand Down

0 comments on commit 10307c4

Please sign in to comment.