Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
2018_web_app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
inutralia
2018_web_app
Commits
b7e3a3a1
Commit
b7e3a3a1
authored
Dec 11, 2018
by
David Villalba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Funcion que busca los inputs seleccionados y los pinta.
parent
75ee7094
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
main.js
public/assets/js/main.js
+85
-0
No files found.
public/assets/js/main.js
View file @
b7e3a3a1
...
...
@@ -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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment