     top         = (options.y or event.pageY or 0) + options.offset.top
     left        = (options.x or event.pageX or 0) + options.offset.left
 
+    expectedTop  = top
+    expectedLeft = left
+
     if top + menuHeight > mainHeight
       top  = mainHeight - menuHeight + options.offset.top
 
     if left + menuWidth > mainWidth
       left  = mainWidth - menuWidth + options.offset.left
 
+    @topMargin  = expectedTop  - top
+    @leftMargin = expectedLeft - left
+
     @getDomElement().css
       width     : "#{options.menuWidth}px"
       top       : top
-      left      : left+      left      : left

    options.arrow          ?= no

    super options, data

    o = @getOptions()


    o.placement or= "top"
    o.margin     ?= 0

    if o.placement in ['top', 'bottom']
      o.margin += @leftMargin
    else
      o.margin += @topMargin

    @arrow = new KDCustomHTMLView
      tagName  : "span"
      cssClass : "arrow #{o.placement}"
