mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
spectrum modification : add position information top container
This commit is contained in:
parent
8cf588b26d
commit
167adaceb0
@ -824,13 +824,21 @@
|
|||||||
var offset = input.offset();
|
var offset = input.offset();
|
||||||
offset.top += inputHeight;
|
offset.top += inputHeight;
|
||||||
|
|
||||||
offset.left -=
|
if (Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth))) {
|
||||||
Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
|
offset.left -= Math.abs(offset.left + dpWidth - viewWidth);
|
||||||
Math.abs(offset.left + dpWidth - viewWidth) : 0);
|
picker.attr('data-x-position','right');
|
||||||
|
} else {
|
||||||
|
offset.left -= 0;
|
||||||
|
picker.attr('data-x-position','left');
|
||||||
|
}
|
||||||
|
|
||||||
offset.top -=
|
if (Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight))) {
|
||||||
Math.min(offset.top, ((offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
|
offset.top -= Math.abs(dpHeight + inputHeight - extraY);
|
||||||
Math.abs(dpHeight + inputHeight - extraY) : extraY));
|
picker.attr('data-y-position','top');
|
||||||
|
} else {
|
||||||
|
offset.top -= extraY;
|
||||||
|
picker.attr('data-y-position','bottom');
|
||||||
|
}
|
||||||
|
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user