spectrum modification : add position information top container

This commit is contained in:
jdescottes 2013-11-28 07:24:08 +01:00
parent 8cf588b26d
commit 167adaceb0

View File

@ -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;
} }