cds-snc / node-starter-app

Quick start application setup.... because you have to start somewhere.
MIT License
5 stars 3 forks source link

WIP - Add toggle area functionality #42

Closed timarney closed 5 years ago

timarney commented 5 years ago

@dsamojlenko

This is a first attempt for adding a generic show hide functionally

See:

https://cds-node-starter-pr-42.herokuapp.com/personal

Would you like to receive notifications? 
()
()

Which should toggle

Notify by
[]
[]

@sastels is looking to have that functionality here https://github.com/cds-snc/simplify-privacy-statements-V2

See my notes here in this file https://github.com/cds-snc/node-starter-app/pull/42/files#diff-b88a18411aa47e705f22c244ccee5d88

sastels commented 5 years ago

❤️

timarney commented 5 years ago

@dsamojlenko any thoughts?

smcmurtry commented 5 years ago

@timarney is it possible to make the "notify by" question default hidden?

timarney commented 5 years ago

@smcmurtry you should be able to add a class

.visually-hidden

To handle that.

timarney commented 5 years ago

Going to work with @dsamojlenko to figure out the format a bit more

Which ties back to https://github.com/cds-snc/node-starter-app/issues/48

and

https://github.com/cds-snc/node-starter-app/pull/57

We need a way to send data to individual elements for things like radios, checkboxes and selects

{{ radioButtons('group_name_for_input', { 'input_1': {classes: "yyy" , id: '"yyy", data-attr: "yyy"},'input_2':{classes: "zzz" , id: '"zzz", data-attr: "zzz"}}) }}

Where the object would contain the properties you want to apply to the individual element.

This will end up being a breaking change but simplify / make things more robust moving forward.

timarney commented 5 years ago

Closing - will create a fresh PR once https://github.com/cds-snc/node-starter-app/pull/57 or sorted out.

timarney commented 5 years ago

Note the code is in use here https://github.com/cds-snc/simplify-privacy-statements-V2