define(['jquery', 'DoughBaseComponent', 'Collapsable'], function($, DoughBaseComponent, Collapsable) {

  'use strict';

  var Popover,
      defaultConfig = {
        direction: 'top',
        halign: true,
        valign: true
      };

  Popover = function($el, config) {
    Popover.baseConstructor.call(this, $el, config, defaultConfig);
    this.$trigger.find('[data-dough-collapsable-icon]').remove();
  };

  /**
   * Inherit from base module, for shared methods and interface
   */
  DoughBaseComponent.extend(Popover, Collapsable);

  Popover.prototype.init = function() {
    Popover.superclass.init.call(this);

    var resize,
        _this = this;

    this.handleResize = $.proxy(this.handleResize, this);
    this.$target.css({
      position: 'absolute'
    });

    $(window).on('resize', function() {
      clearTimeout(resize);
      resize = setTimeout(_this.handleResize, 100);
    });
  };

  Popover.prototype.handleResize = function() {
    this.updatePosition();
  };

  Popover.prototype.toggle = function() {
    Popover.superclass.toggle.call(this);
    this.updatePosition();
  };

  Popover.prototype.updatePosition = function() {
    this.$target.css(this.calculateOffsetFromAnchor(this.config.direction));
  };

  Popover.prototype.centerAlignTargetToTrigger = function(pos, direction) {
    return pos - this.getElementCenterPosition(this.$target)[direction] + this.getElementCenterPosition(this.$trigger)[direction];
  };

  Popover.prototype.calculateOffsetFromAnchor = function(direction) {
    var dispatch;

    dispatch = {
      top: function() {
        var left = this.getElementBoundaries(this.$trigger).left;

        if(this.config.halign) {
          left = this.centerAlignTargetToTrigger(left, 'horizontal');
        }
        if(left < 0) {
          left = 0;
        }
        return {
          left: Math.round(left),
          top: Math.round(this.getElementBoundaries(this.$trigger).bottom - this.$trigger.outerHeight() - this.$target.outerHeight())
        };
      },

      bottom: function() {
        var left = this.getElementBoundaries(this.$trigger).left;

        if(this.config.halign) {
          left = this.centerAlignTargetToTrigger(left, 'horizontal');
        }
        if(left < 0) {
          left = 0;
        }
        return {
          left: Math.round(left),
          top: Math.round(this.getElementBoundaries(this.$trigger).bottom)
        };
      },

      left: function() {
        var top = this.getElementBoundaries(this.$trigger).top;

        if(this.config.valign) {
          top = this.centerAlignTargetToTrigger(top, 'vertical');
        }
        return {
          right: Math.round($('body').width() - this.getElementBoundaries(this.$trigger).left),
          top: Math.round(top)
        };
      },

      right: function() {
        var top = this.getElementBoundaries(this.$trigger).top;

        if(this.config.valign) {
          top = this.centerAlignTargetToTrigger(top, 'vertical');
        }
        return {
          left: Math.round(this.getElementBoundaries(this.$trigger).left + this.$trigger.outerWidth()),
          top: Math.round(top)
        };
      }
    };
    return $.proxy((dispatch[direction] || dispatch.right), this)();
  };

  Popover.prototype.getElementBoundaries = function($el) {
    return {
      top: $el.position().top,
      bottom: $el.position().top + $el.outerHeight(),
      left: $el.position().left,
      right: $el.position().left + $el.outerWidth()
    };
  };

  Popover.prototype.getElementCenterPosition = function($el) {
    return {
      horizontal: $el.outerWidth() / 2,
      vertical: $el.outerHeight() / 2
    };
  };

  return Popover;
});

@@ -1847,32 +1847,20 @@
   left: 
-Math.round(
 left
-)
 ,%0A      
@@ -1864,35 +1864,24 @@
        top: 
-Math.round(
 this.getElem
@@ -1974,17 +1974,16 @@
 Height()
-)
 %0A       
@@ -2293,24 +2293,12 @@
 ft: 
-Math.round(
 left
-)
 ,%0A  
@@ -2310,27 +2310,16 @@
    top: 
-Math.round(
 this.get
@@ -2357,17 +2357,16 @@
 ).bottom
-)
 %0A       
@@ -2612,27 +2612,16 @@
  right: 
-Math.round(
 $('body'
@@ -2677,17 +2677,16 @@
 er).left
-)
 ,%0A      
@@ -2690,39 +2690,27 @@
        top: 
-Math.round(
 top
-)
 %0A        %7D;%0A
@@ -2952,27 +2952,16 @@
   left: 
-Math.round(
 this.get
@@ -3026,17 +3026,16 @@
 rWidth()
-)
 ,%0A      
@@ -3047,23 +3047,11 @@
 op: 
-Math.round(
 top
-)
 %0A   
@@ -3231,16 +3231,27 @@
    top: 
+Math.round(
 $el.posi
@@ -3260,16 +3260,17 @@
 on().top
+)
 ,%0A      
@@ -3277,16 +3277,27 @@
 bottom: 
+Math.round(
 $el.posi
@@ -3326,16 +3326,17 @@
 Height()
+)
 ,%0A      
@@ -3341,16 +3341,27 @@
   left: 
+Math.round(
 $el.posi
@@ -3367,24 +3367,25 @@
 ition().left
+)
 ,%0A      righ
@@ -3387,16 +3387,27 @@
  right: 
+Math.round(
 $el.posi
@@ -3436,16 +3436,17 @@
 rWidth()
+)
 %0A    %7D;%0A

Move value rounding to the method