Let's say I have a reusable module for custom dropdown elements:

class Dropdown extends Module {
  static base = {
    $("p-dropdown")
  }
}





and I have a page, with a 'modal' added to it. This modal has multiple 
dropdowns.
Each modal has its own identifier. What would be the best practice to add 
this to the content?
I do not wish to create additional classes for each type of dropdown that 
extends the Dropdown class above.


class customModal extends Module {
 static base = { $(".modal.is-active") }


 static content = {
 body(wait: true) {$(".modal-card-body")}
 nationalityDropdown(wait: true) { body.find("#nationalityDropdown").module(
Dropdown) }
 genderDropdown(wait: true) { body.find("#genderDropdown").module(Dropdown) 
}
 }
}


(note: the naming is altered to keep it simple. Not exact code in project.)

What would be perfect if I could add content to my customModal something 
like this:

nationalityDropdown(wait: true) { module(Dropdown).where{ id: 
"nationalityDropdown") } }



-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/e6a2fe43-48d0-4c86-bc3c-c47b4b48fe75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to