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
ab0c6934
Commit
ab0c6934
authored
Apr 17, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rerender by removing redundant reValidate() call
parent
f4b2cf71
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
jsonform.gadget.js
jsonform.gadget.js
+2
-6
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+16
-10
No files found.
jsonform.gadget.js
View file @
ab0c6934
...
...
@@ -1030,14 +1030,10 @@
})
.
push
(
function
(
value
)
{
opt
.
value
=
value
;
g
.
props
.
init_value
=
value
;
return
gadget
.
rerender
(
opt
)
.
push
(
function
()
{
if
(
gadget
.
props
.
changed
.
length
>
0
)
{
value
=
undefined
;
}
return
gadget
.
reValidate
(
value
,
opt
.
schema
);
})
.
push
(
function
()
{
delete
g
.
props
.
init_value
;
return
gadget
.
props
.
changed
;
});
});
...
...
jsonform/gadget_json_generated_form_child.js
View file @
ab0c6934
...
...
@@ -2102,6 +2102,7 @@
})
.
declareMethod
(
'
rerender
'
,
function
(
opt
)
{
this
.
props
.
rerender
=
true
;
var
g
=
this
,
for_delete
,
root
=
g
.
element
.
querySelector
(
'
[data-json-path="/"]
'
);
...
...
@@ -2143,9 +2144,10 @@
}
return
el
;
});
return
g
.
checkValidity
(
value
);
return
g
.
checkValidity
(
value
,
opt
.
schema
);
})
.
push
(
function
()
{
g
.
props
.
rerender
=
false
;
return
g
.
element
;
});
})
...
...
@@ -2196,21 +2198,25 @@
.
declareMethod
(
'
getSchema
'
,
function
(
json_document
)
{
var
g
=
this
,
schema_arr
=
g
.
props
.
schema_arr
,
schema_path
;
schema
;
// XXX complex need simplify
if
(
g
.
props
.
render_opt
.
selected_schema
)
{
schema
_path
=
g
.
props
.
render_opt
.
selected_schema
.
schema_path
;
schema
=
g
.
props
.
render_opt
.
selected_schema
;
}
else
{
if
(
json_document
!==
undefined
&&
!
g
.
props
.
render_opt
.
top
)
{
schema
_path
=
schemaArrFilteredByDocument
(
schema_arr
,
json_document
)[
0
].
schema_path
;
}
else
if
(
schema_arr
.
schema_path
)
{
schema
_path
=
schema_arr
.
schema_path
;
schema
=
schemaArrFilteredByDocument
(
schema_arr
,
json_document
)[
0
]
;
}
else
if
(
schema_arr
.
schema_path
&&
!
schema_arr
.
external_reference
)
{
schema
=
schema_arr
;
}
else
if
(
json_document
!==
undefined
)
{
schema
_path
=
schemaArrFilteredByDocument
(
schema_arr
,
json_document
)[
0
].
schema_path
;
schema
=
schemaArrFilteredByDocument
(
schema_arr
,
json_document
)[
0
]
;
}
else
{
schema_path
=
schema_arr
[
0
].
schema_path
;
schema
=
schema_arr
[
0
];
}
}
if
(
schema_arr
&&
schema_arr
.
external_reference
)
{
return
schema
;
}
return
g
.
rootGetSchema
(
schema_path
);
return
g
.
rootGetSchema
(
schema
.
schema
_path
);
})
.
declareMethod
(
'
checkValidity
'
,
function
(
json_document
,
schema
)
{
...
...
@@ -2301,7 +2307,7 @@
})
.
onLoop
(
function
()
{
if
(
this
.
props
.
needValidate
)
{
if
(
this
.
props
.
needValidate
&&
!
this
.
props
.
rerender
)
{
return
this
.
reValidate
();
}
},
500
)
...
...
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