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; +});