Replace closet_hangers/petpage.js with modern CSS
We use jQuery to basically simulate the `:has()` pseudoselector. Let's just, use `:has()` now!
This commit is contained in:
parent
2ab1951e68
commit
4bc38db5aa
3 changed files with 1 additions and 11 deletions
|
@ -1,8 +0,0 @@
|
||||||
(function () {
|
|
||||||
function setChecked() {
|
|
||||||
var el = $(this);
|
|
||||||
el.closest("li").toggleClass("checked", el.is(":checked"));
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#petpage-closet-lists input").click(setChecked).each(setChecked);
|
|
||||||
})();
|
|
|
@ -38,7 +38,7 @@
|
||||||
label
|
label
|
||||||
padding: .25em .75em .25em .25em
|
padding: .25em .75em .25em .25em
|
||||||
|
|
||||||
&.checked
|
&:has(:checked)
|
||||||
background: $module-bg-color
|
background: $module-bg-color
|
||||||
border-radius: 3px
|
border-radius: 3px
|
||||||
border: 1px solid $module-border-color
|
border: 1px solid $module-border-color
|
||||||
|
|
|
@ -29,7 +29,5 @@
|
||||||
:lists_by_owned => @visible_closet_lists_by_owned,
|
:lists_by_owned => @visible_closet_lists_by_owned,
|
||||||
:unlisted_hangers_by_owned => @visible_unlisted_closet_hangers_by_owned)
|
:unlisted_hangers_by_owned => @visible_unlisted_closet_hangers_by_owned)
|
||||||
|
|
||||||
- content_for :javascripts_body do
|
|
||||||
= javascript_include_tag 'jquery', 'closet_hangers/petpage'
|
|
||||||
- content_for :stylesheets do
|
- content_for :stylesheets do
|
||||||
= stylesheet_link_tag 'closet_hangers/petpage'
|
= stylesheet_link_tag 'closet_hangers/petpage'
|
||||||
|
|
Loading…
Reference in a new issue