So, if i have to add a custom xtype or custom validation for my dialog or anything that would require me to create a clientlibs for the particular dialog, setting categories to cq.widgets for classic ui and cq.authoring.dialog for touch ui, How would i ensure that the scripts i add in this clientlibs is not used by any other dialog but this one. As it causes problems, because similar triggers are applicable to all the dialogs which hampers the working of other dialogs as the functions are global.
In short, How do i restrict the clientlibs to only the dialog it is meant for. (for both touch and classic keeping cq.authoring.dialog and cq.widgets categories respectively)