Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
mini-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit c5247537
authored
2019-11-22 14:40:54 +0000
by
Luciano Barletta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
merged js
1 parent
21491ae8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
Scripts/construct.js
Scripts/construct.js
View file @
c524753
...
@@ -2,22 +2,26 @@
...
@@ -2,22 +2,26 @@
* Armado de formulario
* Armado de formulario
*/
*/
function
removeField
(
b
){
function
removeField
(
b
){
let
div
=
b
.
parentElement
;
while
(
b
.
getAttribute
(
"name"
)
==
"Field"
)
b
=
b
.
parentElement
;
let
tab
=
div
.
parentElement
;
if
(
b
.
nodeElement
==
"body"
)
return
;
tab
.
removeChild
(
div
);
b
.
parentElement
.
removeChild
(
b
);
}
}
function
addField
(
b
){
function
addField
(
b
){
let
newfield
=
document
.
createElement
(
"div"
);
let
newfield
=
document
.
createElement
(
"div"
);
newfield
.
setAttribute
(
"name"
,
"Field"
);
newfield
.
setAttribute
(
"name"
,
"Field"
);
newfield
.
innerHTML
=
document
.
getElementById
(
"fieldTemplate"
).
innerHTML
;
newfield
.
innerHTML
=
document
.
getElementById
(
"fieldTemplate"
).
innerHTML
;
b
.
parentElement
.
appendChild
(
newfield
);
let
tab
=
b
.
parentElement
;
// swap
tab
.
removeChild
(
b
);
tab
.
appendChild
(
newfield
);
tab
.
appendChild
(
b
);
}
}
function
removeTab
(
b
){
function
removeTab
(
b
){
let
div
=
b
.
parentElement
;
while
(
b
.
getAttribute
(
"name"
)
==
"Tab"
)
b
=
b
.
parentElement
;
let
tab
=
div
.
parentElement
;
if
(
b
.
nodeElement
==
"body"
)
return
;
tab
.
removeChild
(
div
);
b
.
parentElement
.
removeChild
(
b
);
}
}
function
addTab
(
t
){
function
addTab
(
t
){
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment