mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Allow RED.popover.panel to specify a closeButton to ignore click events on
This commit is contained in:
		| @@ -363,7 +363,6 @@ RED.popover = (function() { | ||||
|             panel.css({ display: "none" }); | ||||
|             panel.appendTo(document.body); | ||||
|             content.appendTo(panel); | ||||
|             var closeCallback; | ||||
|  | ||||
|             function hide(dispose) { | ||||
|                 $(document).off("mousedown.red-ui-popover-panel-close"); | ||||
| @@ -378,6 +377,7 @@ RED.popover = (function() { | ||||
|             } | ||||
|             function show(options) { | ||||
|                 var closeCallback = options.onclose; | ||||
|                 var closeButton = options.closeButton; | ||||
|                 var target = options.target; | ||||
|                 var align = options.align || "right"; | ||||
|                 var offset = options.offset || [0,0]; | ||||
| @@ -393,7 +393,7 @@ RED.popover = (function() { | ||||
|                     top -= (top+panelHeight)-$(window).height() + 5; | ||||
|                 } | ||||
|                 if (top < 0) { | ||||
|                     panelHeight.height(panelHeight+top) | ||||
|                     panel.height(panelHeight+top) | ||||
|                     top = 0; | ||||
|                 } | ||||
|                 if (align === "right") { | ||||
| @@ -420,7 +420,8 @@ RED.popover = (function() { | ||||
|                 }); | ||||
|  | ||||
|                 $(document).on("mousedown.red-ui-popover-panel-close", function(event) { | ||||
|                     if(!$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) { | ||||
|                     var hitCloseButton = closeButton && $(event.target).closest(closeButton).length; | ||||
|                     if(!hitCloseButton && !$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) { | ||||
|                         if (closeCallback) { | ||||
|                             closeCallback(); | ||||
|                         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user