mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	confirm_dialog: Add post_render support in confirm_dialog.
This will be used by other modals when we will migrate those to use the same code as that of confirm_dialog.
This commit is contained in:
		@@ -34,6 +34,9 @@ import * as settings_data from "./settings_data";
 | 
				
			|||||||
           This will show a loading spinner when the yes button is clicked.
 | 
					           This will show a loading spinner when the yes button is clicked.
 | 
				
			||||||
           The caller is responsible for calling hide_dialog_spinner()
 | 
					           The caller is responsible for calling hide_dialog_spinner()
 | 
				
			||||||
           to hide the spinner in both success and error handlers.
 | 
					           to hide the spinner in both success and error handlers.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        7) If a caller needs to run code after the modal body is added
 | 
				
			||||||
 | 
					           to DOM, it can do so by passing a post_render hook.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function hide_dialog_spinner() {
 | 
					export function hide_dialog_spinner() {
 | 
				
			||||||
@@ -98,6 +101,10 @@ export function launch(conf) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    submit_button_span.html(conf.html_submit_button);
 | 
					    submit_button_span.html(conf.html_submit_button);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (conf.post_render !== undefined) {
 | 
				
			||||||
 | 
					        conf.post_render();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const submit_button = dialog.find(".dialog_submit_button");
 | 
					    const submit_button = dialog.find(".dialog_submit_button");
 | 
				
			||||||
    // Set up handlers.
 | 
					    // Set up handlers.
 | 
				
			||||||
    submit_button.on("click", () => {
 | 
					    submit_button.on("click", () => {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user