Skip to content

Commit 005bfeb

Browse files
author
FezVrasta
committed
.box > .check
1 parent cb117d1 commit 005bfeb

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

less/checkboxes.less

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
opacity: 0;
2626
margin: 0;
2727
}
28-
.box {
28+
.check {
2929
border: 2px solid @lightbg-text;
3030
height: 20px;
3131
width: 20px;
@@ -39,7 +39,7 @@
3939
// Hide native checkbox
4040
input[type=checkbox] { display: none; }
4141

42-
input[type=checkbox] ~ .box {
42+
input[type=checkbox] ~ .check {
4343
position: absolute;
4444
top: 0px;
4545
left: 0px;
@@ -50,7 +50,7 @@
5050
.animation(uncheck 300ms ease-out forwards);
5151
}
5252

53-
input[type=checkbox]:checked ~ .box {
53+
input[type=checkbox]:checked ~ .check {
5454
.animation(check 300ms ease-out forwards);
5555
}
5656

@@ -63,14 +63,13 @@
6363
}
6464

6565
// Style for disabled inputs
66-
input[type=checkbox][disabled]:not(:checked) ~ .box {
66+
input[type=checkbox][disabled]:not(:checked) ~ .check {
6767
opacity: 0.5;
6868
}
6969
input[type=checkbox][disabled] ~ .ripple {
7070
background-color: @lightbg-text;
7171
}
7272

73-
7473
.variations(~" input[type=checkbox]:checked ~ .ripple", background-color, @success);
7574
}
7675

scripts/material.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $(function (){
55
ripples.init(".btn:not(.btn-link), .navbar a, .nav-tabs a, .withripple");
66

77
// Add fake-checkbox to material checkboxes
8-
$(".checkbox label input").after("<span class=ripple></span><span class=check></span><span class=box></span>");
8+
$(".checkbox label input").after("<span class=ripple></span><span class=check></span>");
99

1010
// Add fake-radio to material radios
1111
$(".radio label input").after("<span class=ripple></span><span class=circle></span><span class=check></span>");
@@ -24,19 +24,6 @@ $(function (){
2424
}
2525
});
2626

27-
// Material inputs engine (ripple effect)
28-
/*$(document).on("mouseup", ".checkbox label, .radio label", function() {
29-
console.log("click");
30-
var $ripple = $(this).find(".ripple");
31-
32-
$ripple.addClass("animate");
33-
var timer = setTimeout(function() {
34-
console.log("out");
35-
clearTimeout(timer);
36-
$ripple.removeClass("animate");
37-
}, 800);
38-
});*/
39-
4027
$(document).on("change", ".form-control", function() {
4128
if ($(this).val() !== "") {
4229
$(this).removeClass("empty");

0 commit comments

Comments
 (0)