mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	user settings: Fix active background links when a modal is visible.
A bug caused background links to open even when a modal in the user settings overlay was active in the foreground. This commit fixes this by disabling mouse events for the background when the modal is active, and restoring them as soon as the modal starts closing. Fixes #10654.
This commit is contained in:
		@@ -102,6 +102,8 @@ exports.open_modal = function (name) {
 | 
			
		||||
    blueslip.debug('open modal: ' + name);
 | 
			
		||||
 | 
			
		||||
    $("#" + name).modal("show").attr("aria-hidden", false);
 | 
			
		||||
    // Disable background mouse events when modal is active
 | 
			
		||||
    $('.overlay.show').attr("style", "pointer-events: none");
 | 
			
		||||
    // Remove previous alert messsages from modal, if exists.
 | 
			
		||||
    $("#" + name).find(".alert").hide();
 | 
			
		||||
};
 | 
			
		||||
@@ -163,6 +165,9 @@ exports.close_modal = function (name) {
 | 
			
		||||
    blueslip.debug('close modal: ' + name);
 | 
			
		||||
 | 
			
		||||
    $("#" + name).modal("hide").attr("aria-hidden", true);
 | 
			
		||||
    // Enable mouse events for the background as the modal closes.
 | 
			
		||||
    $('.overlay.show').attr("style", null);
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.close_active_modal = function () {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user