mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add RED.popover.tooltip for common reuse
This commit is contained in:
		| @@ -53,7 +53,12 @@ RED.popover = (function() { | ||||
|                     div.addClass("red-ui-popover-size-"+size); | ||||
|                 } | ||||
|                 if (typeof content === 'function') { | ||||
|                     content.call(res).appendTo(div); | ||||
|                     var result = content.call(res); | ||||
|                     if (typeof result === 'string') { | ||||
|                         div.text(result); | ||||
|                     } else { | ||||
|                         div.append(result); | ||||
|                     } | ||||
|                 } else { | ||||
|                     div.html(content); | ||||
|                 } | ||||
| @@ -63,8 +68,8 @@ RED.popover = (function() { | ||||
|  | ||||
|  | ||||
|                 var targetPos = target.offset(); | ||||
|                 var targetWidth = target.width(); | ||||
|                 var targetHeight = target.height(); | ||||
|                 var targetWidth = target.outerWidth(); | ||||
|                 var targetHeight = target.outerHeight(); | ||||
|                 var divHeight = div.height(); | ||||
|                 var divWidth = div.width(); | ||||
|                 if (direction === 'right') { | ||||
| @@ -147,7 +152,17 @@ RED.popover = (function() { | ||||
|     } | ||||
|  | ||||
|     return { | ||||
|         create: createPopover | ||||
|         create: createPopover, | ||||
|         tooltip: function(target,content) { | ||||
|             RED.popover.create({ | ||||
|                 target:target, | ||||
|                 trigger: "hover", | ||||
|                 size: "small", | ||||
|                 direction: "bottom", | ||||
|                 content: content, | ||||
|                 delay: { show: 550, hide: 10 } | ||||
|             }); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| })(); | ||||
|   | ||||
| @@ -349,14 +349,7 @@ RED.tabs = (function() { | ||||
|                         pinnedLink.addClass("red-ui-tab-link-button-pinned"); | ||||
|                         pinnedTabsCount++; | ||||
|                     } | ||||
|                     RED.popover.create({ | ||||
|                         target:$(pinnedLink), | ||||
|                         trigger: "hover", | ||||
|                         size: "small", | ||||
|                         direction: "bottom", | ||||
|                         content: tab.name, | ||||
|                         delay: { show: 550, hide: 10 } | ||||
|                     }); | ||||
|                     RED.popover.tooltip($(pinnedLink), tab.name); | ||||
|  | ||||
|                 } | ||||
|                 link.on("click",onTabClick); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user