Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
message_admin - Properly cleanup the
onPreview
listener
Use-case: 1. Open the editor a message template (eg `#/edit?id=17&lang=fr_FR`). This renders the edit screen. 2. Click on the "Preview" icon. 3. Close the "Preview" dialog. 4. Change the URL to navigate internally to another template (eg `#/edit?id=17&lang=de_DE`). This renders the edit screen again. 5. Click on the "Preview" icon. Before: * It subsequently opens two copies of the "Preview" dialog (each with slightly different options). Initially, you see one dialog. When that close, you will see the other dialog. * As you proceed through closing the dialogs, you may get console warnings because the dialogs have the same name -- and they consequently trip-up each other. After: * It only opens one copy of the "Preview" dialog. Technical Details: * When rendering the setup screen (`#1`/`civicrm#4`), it registers a listener which will handle the "Preview" clicks. But the listener is not properly unregistered. Consequently, old listeners hang around. So the click at step `civicrm#5` calls both the old+new listeners, creating two dialogs.
- Loading branch information