Commit 2d8aa368 by Georgina Mondino

Boton de Borrar Tab

1 parent 2f588b4f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Armado de formulario * Armado de formulario
*/ */
function removeField(b){ function removeField(b){
while(b.getAttribute("name") == "Field") b = b.parentElement; while(b.getAttribute("name") != "Field") b = b.parentElement;
if(b.nodeElement == "body") return; if(b.nodeElement == "body") return;
b.parentElement.removeChild(b); b.parentElement.removeChild(b);
} }
...@@ -19,7 +19,7 @@ function addField(b){ ...@@ -19,7 +19,7 @@ function addField(b){
} }
function removeTab(b){ function removeTab(b){
while(b.getAttribute("name") == "Tab") b = b.parentElement; while(b.getAttribute("name") != "Tab") b = b.parentElement;
if(b.nodeElement == "body") return; if(b.nodeElement == "body") return;
b.parentElement.removeChild(b); b.parentElement.removeChild(b);
} }
......
...@@ -20,8 +20,8 @@ body{ ...@@ -20,8 +20,8 @@ body{
} }
.TabTitle{ .TabTitle{
font-size: 30px; font-size: 30px;
width: 100%; width: 94%;
text-align: center; text-align: left;
border:none; border:none;
border-bottom: 1px solid grey; border-bottom: 1px solid grey;
} }
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
<template id="tabTemplate"> <template id="tabTemplate">
<div class="TabCards"> <div class="TabCards">
<input class="TabTitle" placeholder="Titulo del Tab" type="text"> <input class="TabTitle" placeholder="Titulo del Tab" type="text">
<button class="RemoveInputButton" onclick="removeTab(this)">
X
</button>
<br> <br>
<div style="text-align: center;"> <div style="text-align: center;">
<button class="NewInputButton" onclick="addField(this)"> <button class="NewInputButton" onclick="addField(this)">
...@@ -40,6 +43,7 @@ ...@@ -40,6 +43,7 @@
<template id="fieldTemplate"> <template id="fieldTemplate">
<div class="InputContainer"> <div class="InputContainer">
<input type="text" id="Titulo" class="Input" placeholder="Título"> <input type="text" id="Titulo" class="Input" placeholder="Título">
<select name="input" class="Input"> <select name="input" class="Input">
<option disabled selected value="">Input</option> <option disabled selected value="">Input</option>
<option id="text" value="text">Texto</option> <option id="text" value="text">Texto</option>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!