From 33a280e033b2869481c3d6eeffeb82c6ba969975 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 14 Mar 2016 10:57:00 -0300 Subject: [PATCH] Adiciona arte JS do autor --- static/js/app.js | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index 87d7b099f..c07bf4b2e 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -16,7 +16,81 @@ function refreshMask() { $('.hora_hms').mask("00:00:00", {placeholder:"hh:mm:ss"}); } +function autorModal() { + + $(function() { + var dialog = $("#modal_autor").dialog({ + autoOpen: false, + modal: true, + width: 500, + height: 300, + show: { + effect: "blind", + duration: 500 }, + hide: { + effect: "explode", + duration: 500 + } + }); + + $( "#button-id-limpar" ).click(function() { + $("#nome_autor").text(''); + $("#id_autor").val(null); + }); + + $("#button-id-pesquisar").click(function() { + $("#q").val(''); + $("#div-resultado").children().remove(); + $("#modal_autor").dialog( "open" ); + $("#selecionar").attr("hidden", "hidden"); + }); + + $( "#pesquisar" ).click(function() { + var query = $("#q").val() + + $.get("/proposicoes/pesquisar_autores?q="+ query, function( + data, status){ + + $("#div-resultado").children().remove(); + + if (data.length == 0) { + $("#selecionar").attr("hidden", "hidden"); + $("#div-resultado").html( + "Nenhum resultado"); + return; + } + + var select = $( + '