From 9a5bda49178d2c0e6f209ef1d96765b32f1c55db Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Sun, 25 Sep 2016 18:22:07 -0700 Subject: [PATCH] [Selection] Sketch in overlay manager --- src/ui/OverlayManager.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/ui/OverlayManager.js diff --git a/src/ui/OverlayManager.js b/src/ui/OverlayManager.js new file mode 100644 index 0000000000..cbfcf0eb82 --- /dev/null +++ b/src/ui/OverlayManager.js @@ -0,0 +1,24 @@ +define(['zepto'], function ($) { + function OverlayManager(bodyElement) { + this.$body = $(bodyElement); + } + + OverlayManager.prototype.show = function (view, x, y) { + var $container = $('
'); + + 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; +});