mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[Selection] Sketch in overlay manager
This commit is contained in:
24
src/ui/OverlayManager.js
Normal file
24
src/ui/OverlayManager.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
define(['zepto'], function ($) {
|
||||||
|
function OverlayManager(bodyElement) {
|
||||||
|
this.$body = $(bodyElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
OverlayManager.prototype.show = function (view, x, y) {
|
||||||
|
var $container = $('<div></div>');
|
||||||
|
|
||||||
|
x = x || 0;
|
||||||
|
y = y || 0;
|
||||||
|
|
||||||
|
$container.attr('left', x + 'px');
|
||||||
|
$container.attr('top', y + 'px');
|
||||||
|
|
||||||
|
view.show($container[0]);
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
$container.remove();
|
||||||
|
view.destroy();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return OverlayManager;
|
||||||
|
});
|
Reference in New Issue
Block a user