(Split off from #1963124: Resolve WCAG2 accessibility errors on main settings page.)

Add a 'show' #states handler for toggling the standard 'element-invisible' class in order to show/hide form field elements. It has some proper API usage documentation, so why not ...

Comments

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

This adds a new "states-show.js" file based on code from micnap in #1963124: Resolve WCAG2 accessibility errors on main settings page - she deserves all of the credit.

japerry’s picture

+++ b/js/states-show.js
@@ -0,0 +1,40 @@
+  // Show/hide form items by toggling the 'element-invisible' class. This is a
+  // more accessible option than ¶

than what?

Otherwise looks decent. I'll have to test it. I guess you need to add the js manually for it to work with the states?

damienmckenna’s picture

StatusFileSize
new1.36 KB

Doh! I've updated the comments.

dsnopek’s picture

Status: Needs review » Needs work
+++ b/js/states-show.js
@@ -0,0 +1,44 @@
+    console.log(e.value);

A debugging statement snuck into the patch!

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new794 bytes

Removed. Thanks for spotting that, dsnopek.

Status: Needs review » Needs work

The last submitted patch, 5: ctools-n2493041-5.patch, failed testing.

dsnopek’s picture

New patch looks like an interdiff rather than a full patch! Leaving at "Needs work" (which the testbot did for us).

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB

*facepalm*. Forgot I needed to create a diff against HEAD, because it was for a new file.

This should work.

dawehner’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Given that #1963124: Resolve WCAG2 accessibility errors on main settings page was committed we should add the JS files now. I'll just blindly RTBC it :P

damienmckenna’s picture

@dawehner: yeah, I kinda jumped the gun on it, sorry ;)

rivimey’s picture

Just a note: Current panelizer 7.x-3.x-dev has committed a patch that requires this change.

http://cgit.drupalcode.org/panelizer/commit/?id=1c39a213eda19ecae24a1b08...

damienmckenna’s picture

dpolant’s picture

Tested and it is working.

ckrina’s picture

It's working for me too.

japerry’s picture

Status: Reviewed & tested by the community » Fixed

What? Blind RTBC a patch? Pish I'll one-up you. Lets blind commit it! (Kidding. looks fine in my limited testing capability)

Fixed. ;)

  • japerry committed b0e532f on 7.x-1.x authored by DamienMcKenna
    Issue #2493041 by DamienMcKenna: Add 'show' state handler for hiding/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.