Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Feb 2011 at 18:38 UTC
Updated:
20 Mar 2020 at 16:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dmitriy.trt commentedsubscribing
Comment #2
dmitriy.trt commentedIt works, thanks a lot! Patch makes it possible to depend on "checkboxes" element with simple condition like:
This means "element is invisible if all of checkboxes are unchecked".
Comment #3
rfayD8 first. Let's get these fixed on D8 and into D7.
Comment #4
sundrupal.states-checked.0.patch queued for re-testing.
Comment #5
james.williamssubscribe
Comment #6
geerlingguy commentedSub.
Comment #7
nagiek commentedPatch works for me, running Drupal 7.10. Handy!
Comment #8
nagiek commentedComment #9
sunRe-rolled against latest HEAD.
Comment #10
catchLooks fine, has had manual testing, shame we don't have qunit for stuff like this.
Committed/pushed to 8.x, back to 7.x for backport.
Comment #11
albert volkman commentedD7 backport.
Comment #12
albert volkman commentedbump (and updated patch to apply cleanly)
Comment #13
sunThis patch looks safe to backport for me, but I wonder whether the jQuery in D7 core supports .prop()?
(I guess it does, since I originally rolled this patch for D7, but I'm not 100% sure.)
Comment #14
albert volkman commentedGood point. Just checked this and D7 has jQuery 1.4.4-
http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/misc/jquer...
and .prop() wasn't introduced until jQuery 1.6-
http://api.jquery.com/prop/
Perhaps we should use .is() instead?
Comment #15
sunPerhaps @nod_ can help out with those question.
Comment #16
dmitriy.trt commentedPatch #14 doesn't work because of missing colon before "checked" pseudo-class. Updated patch attached.
Comment #17
jason.fisher commented@16
Are you missing the check to see if it is checked? It seems like you are always returning the state of the first checkbox?
Comment #18
dmitriy.trt commented@jason.fisher,
Innermost function breaks the
jQuery.each()loop only if checked checkbox is found. Otherwise the loop will move to the next one. See jQuery API documentation:Comment #19
mgiffordNot surprising that the patch from 2 years ago needs a reroll.
Comment #20
rpayanmComment #21
mgiffordComment #22
mgifford@rpayanm reroll applies nicely in SimplyTest.me
What do we need to do to test this patch to mark it RTBC?