Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
42b8f77d
Commit
42b8f77d
authored
Apr 20, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erro_message element hide if not contain error message
parent
519056da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
gadget_json_generated_form.js
gadget_json_generated_form.js
+13
-8
No files found.
gadget_json_generated_form.js
View file @
42b8f77d
...
@@ -603,7 +603,7 @@
...
@@ -603,7 +603,7 @@
label
,
label
,
div_input
,
div_input
,
span_info
,
span_info
,
span_error
,
error_message
,
input
,
input
,
first_path
,
first_path
,
queue
=
RSVP
.
Queue
();
queue
=
RSVP
.
Queue
();
...
@@ -732,9 +732,10 @@
...
@@ -732,9 +732,10 @@
span_info
.
textContent
=
json_field
.
info
;
span_info
.
textContent
=
json_field
.
info
;
div_input
.
appendChild
(
span_info
);
div_input
.
appendChild
(
span_info
);
}
}
span_error
=
document
.
createElement
(
"
span
"
);
error_message
=
document
.
createElement
(
"
span
"
);
span_error
.
setAttribute
(
"
class
"
,
"
error
"
);
error_message
.
setAttribute
(
"
class
"
,
"
error
"
);
div_input
.
appendChild
(
span_error
);
error_message
.
hidden
=
true
;
div_input
.
appendChild
(
error_message
);
div
.
appendChild
(
div_input
);
div
.
appendChild
(
div_input
);
return
queue
return
queue
...
@@ -1235,8 +1236,9 @@
...
@@ -1235,8 +1236,9 @@
var
index
,
var
index
,
tasks
=
[];
tasks
=
[];
g
.
element
.
querySelectorAll
(
"
span.error
"
).
forEach
(
function
(
span
)
{
g
.
element
.
querySelectorAll
(
"
.error
"
).
forEach
(
function
(
error_message
)
{
span
.
textContent
=
""
;
error_message
.
textContent
=
""
;
error_message
.
hidden
=
true
;
});
});
g
.
element
.
querySelectorAll
(
"
div.error-input
"
).
forEach
(
function
(
div
)
{
g
.
element
.
querySelectorAll
(
"
div.error-input
"
).
forEach
(
function
(
div
)
{
...
@@ -1250,9 +1252,12 @@
...
@@ -1250,9 +1252,12 @@
}
}
function
print_error
(
message
)
{
function
print_error
(
message
)
{
return
function
(
element
)
{
return
function
(
element
)
{
var
id
=
element
.
id
;
var
id
=
element
.
id
,
error_message
;
element
.
setAttribute
(
"
class
"
,
"
error-input
"
);
element
.
setAttribute
(
"
class
"
,
"
error-input
"
);
element
.
querySelector
(
"
#
"
+
id
.
replace
(
"
/
"
,
"
\\
/
"
)
+
"
> span.error
"
).
textContent
=
message
;
error_message
=
element
.
querySelector
(
"
#
"
+
id
.
replace
(
"
/
"
,
"
\\
/
"
)
+
"
> .error
"
);
error_message
.
textContent
=
message
;
error_message
.
hidden
=
false
;
};
};
}
}
for
(
index
in
validation
.
errors
)
{
for
(
index
in
validation
.
errors
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment