code: function (element) {
        var bounds = angular.element(element)[0].getBoundingClientRect();
        var isPositiveSizeClientRect = function (rect) {
          return rect && (rect.width > 0) && (rect.height > 0);
        };
  
        // If the event origin element has zero size, it has probably been hidden.
        return isPositiveSizeClientRect(bounds) ? self.copyRect(bounds) : null;
      }
docs: Calculate ClientRect of element; return null if hidden or zero size