mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow popover position to be set via absolute pos rather than relative
This commit is contained in:
parent
ea46947054
commit
6bea3dabbb
@ -610,10 +610,13 @@ RED.popover = (function() {
|
||||
var target = options.target;
|
||||
var align = options.align || "right";
|
||||
var offset = options.offset || [0,0];
|
||||
var xPos = options.x;
|
||||
var yPos = options.y;
|
||||
var isAbsolutePosition = (xPos !== undefined && yPos !== undefined)
|
||||
|
||||
var pos = target.offset();
|
||||
var targetWidth = target.width();
|
||||
var targetHeight = target.outerHeight();
|
||||
var pos = isAbsolutePosition?{left:xPos, top: yPos}:target.offset();
|
||||
var targetWidth = isAbsolutePosition?0:target.width();
|
||||
var targetHeight = isAbsolutePosition?0:target.outerHeight();
|
||||
var panelHeight = panel.height();
|
||||
var panelWidth = panel.width();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user