Add base dialog class that can be used to implement responsive JS dialogs

Is there something it sets on the dom that you check with an interval instead of a fixed timeout?