Skip to content

Commit

Permalink
versão final
Browse files Browse the repository at this point in the history
  • Loading branch information
Orion Darshan Winter de Lima 113110076 committed Oct 24, 2014
1 parent 77b695c commit e0eb001
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion dinamica/css/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.mover, .remover {
float: right;
transform: translate(0px,-7px);
transform: translate(0px,-34px);
}
48 changes: 26 additions & 22 deletions dinamica/js/script_da_terceira_pagina.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@
* Created by Órion on 21/10/2014.
*/

function adicionarAListaParaAprender(){
item = $("#input_assunto").val();
if (item == ""){
return;
$( document ).ready(function() {
$( "form" ).submit(function() {
item = $("#input_assunto").val();
if (item == "") {
return;
}
item = "<p>"+item+"</p>";
mover = "<button class='btn btn-warning mover'> Mover para aprendidos</button>";
remover = "<button class='btn btn-danger remover'> Remover</button>";
$("#listaDeTemasAAprender").append("<li class='list-group-item'>" + item + mover + remover + "</li>");
limpaCampoInput();
return false;
});

function limpaCampoInput(){
$("#input_assunto").val("");
}
mover = "<button onclick='moverParaAprendidos(this)' class='btn btn-warning mover'> Mover para aprendidos</button>";
remover = "<button onclick='removerDaPagina(this)' class='btn btn-danger remover'> Remover</button>";
$("#listaDeTemasAAprender").append("<li class='list-group-item'>"+item+mover+remover+"</li>");
limpaCampoInput();
return false;
}

function moverParaAprendidos(botao){
parent = botao.parentElement;
tema = parent.firstChild.textContent;
$("#listaDeTemasJaAprendido").append("<li class='list-group-item'>" +tema+ "</li>");
parent.remove();
}
$("#listaDeTemasAAprender").on("click", ".mover", function() {
var parent = $(this).parent();
var tema = parent.find("p").text();
$("#listaDeTemasJaAprendido").append("<li class='list-group-item'>" + tema + "</li>");
parent.remove();
});

function removerDaPagina(botao){
botao.parentElement.remove();
}
$("#listaDeTemasAAprender").on("click", ".remover", function(){
$(this).parent().remove();
});
});

function limpaCampoInput(){
$("#input_assunto").val("");
}
2 changes: 1 addition & 1 deletion dinamica/terceira_pagina.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>Assuntos que gostaria de aprender</h3>
</div>
<div class="panel-body">

<form class="form-inline" role="form" onsubmit="adicionarAListaParaAprender();return false;">
<form class="form-inline" role="form">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Assunto para aprender</div>
Expand Down

0 comments on commit e0eb001

Please sign in to comment.