From 92059f3e3d4624474d410cfb16c1bf6c0698774b Mon Sep 17 00:00:00 2001 From: Guillermo Moguel Mandujano Date: Mon, 16 Jun 2014 18:56:10 -0500 Subject: [PATCH] Finalizado parcial --- index.html | 25 +++++++++++-------------- js/jquery.mutable.js | 20 ++++++++------------ 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/index.html b/index.html index 708d752..c28d914 100644 --- a/index.html +++ b/index.html @@ -20,12 +20,18 @@ valueselector:"No, ¿Por que?", }); + $("#id_cencontrabajo").mutarSelect({ + valueselector:"¿Otra forma, Cual?", + }); - $("id_cencontrabajo").mutarSelect({ + $("#id_arealaboral").mutarSelect({ valueselector:"¿Otra forma, Cual?", }); - - + + $("#id_dedicacionem").mutarSelect({ + valueselector:"¿Otra, Cual?", + }); + }); @@ -84,7 +90,7 @@ - @@ -94,13 +100,11 @@ - - + diff --git a/js/jquery.mutable.js b/js/jquery.mutable.js index 4ebfc13..450cc5a 100644 --- a/js/jquery.mutable.js +++ b/js/jquery.mutable.js @@ -7,22 +7,18 @@ valueselector:"Agregar nuevo", }, options ); - var selector = this; - selector.append(""); + var father = $(this).attr("id"); + $(this).append(""); - $(".mutarselect-add").click(function( event ){ + $("#" + father + " .mutarselect-add").click(function( event ){ event.preventDefault(); - - //alert($(this).parent(".mutarselect").attr("id")); - var father = $(this).parent(selector).attr("id"); - //var positionReal = $(this).parent(".mutarselect").offset(); - // + $("#" + father + " .mutarselect-rm" ).remove(); - - $(this).parent(".mutarselect").hide(); - $("").insertAfter( $($(this).parent(".mutarselect")) ); + $(this).parent("#" + father).hide(); + + $("").insertAfter( $(this).parent(".mutarselect") ); + }); - $("form").on("keypress", ".mutarselect-input",function( event ){ if ( event.keyCode == '13' ){ -- 2.0.0