Commit b7e3a3a1 by David Villalba

Funcion que busca los inputs seleccionados y los pinta.

parent 75ee7094
......@@ -9,6 +9,10 @@ $(window).load(function() {
var height_screen =jQuery(window).height(); // return height of browser viewport
$(".cs-loader").css("min-height", height_screen);
// Control Checked inputs
control_inputs_checked();
});
......@@ -70,3 +74,84 @@ $(function () {
})
/**
* Busca los input seleccionados.
*/
function control_inputs_checked() {
$(':input:checked').map(function () {
diff_input_checked(this);
});
}
/**
* Identidica el tipo de input seleccionado
*
* @param el
*/
function diff_input_checked(el) {
var class_separate = $(el).closest("form").attr('class').split(' ');
var class_type = class_separate[class_separate.length-1];
var type_separate = class_type.split('-');
var type = type_separate[type_separate.length -1];
switch (type) {
case 'cross' :
case 'checkmark' :
case 'boxfill' :
case 'diagonal' :
case 'list' :
print_checkbox_checked(el,type);
break;
case 'fill' :
case 'circle' :
case 'swirl' :
print_radio_checked(el,type);
break;
}
}
/**
* Marca los input de tipo checkbox
*
* @param el
* @param type
*/
function print_checkbox_checked(el,type) {
if( el.checked ) {
draw( el, type );
}
else {
reset( el );
}
}
/**
*
* Marca los inputs de tipo radio.
*
* @param el
* @param type
*/
function print_radio_checked(el,type) {
resetRadio( el );
draw( el, type );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment