move get element offset function to service
better way of determining whether an element is raw dom element or element wrapped with AngularJS jqLite