I may have found a bug in the $telerik.getLocation method. I'm using version 2013.3.1324.10 of Telerik UI for ASP.NET AJAX. We ran into an issue in one of our applications where as a user scrolls down a page that contains an AjaxLoadingPanel, when the panel is shown it is shows further up the page than the Ajax panel it should be covering. If I scroll down the page 70px, the AjaxLoadingPanel displays exactly 70px above the panel it should be displaying over. This issue occurs in all webkit based browsers (safari & chrome).
Digging through the telerik client side source we determined that the issue stems from the $telerik.getLocation method. On our page we have 5 total forms, the first of which is hidden within model markup at the top of the page. The $telerik.getLocation method has a specific case towards the end, where it checks if the browser is Safari (really checking for webkit apparently) and if it is, it gets all the forms on the page, then it calls originalGetLocation on the first form in that list. This is where we run into problems. If that form is hidden, originalGetLocation returns a Point object with an x of 0 and y of 0. The script goes on to check if these values are less than zero, if they are it attempts to increment the x and y value of ajax panel by the scroll value of the window which is what is required in order to correctly calculate the position of an element in a webkit browser. The problem is, since originalGetLocation returns 0 for x & y, the increment never happens so as you scroll down the page telerik fails to factor in your scroll and you loading panel shows further and further above the element it should cover.
I'm not posting the telerik code because I wasn't for sure if it is allowed to add the telerik source that seems to be the problem. Our current source is currently too much to post as an example but I'll try to come up with smaller test case to illustrate the bug.
In the meantime, I've found the removing the check for whether x&y of the form is less than zero and simply incrementing the value no matter what seems to solve the issue in my particular case. Of course, I'd rather not have to override a core method of the telerik source if there is another work around.
Digging through the telerik client side source we determined that the issue stems from the $telerik.getLocation method. On our page we have 5 total forms, the first of which is hidden within model markup at the top of the page. The $telerik.getLocation method has a specific case towards the end, where it checks if the browser is Safari (really checking for webkit apparently) and if it is, it gets all the forms on the page, then it calls originalGetLocation on the first form in that list. This is where we run into problems. If that form is hidden, originalGetLocation returns a Point object with an x of 0 and y of 0. The script goes on to check if these values are less than zero, if they are it attempts to increment the x and y value of ajax panel by the scroll value of the window which is what is required in order to correctly calculate the position of an element in a webkit browser. The problem is, since originalGetLocation returns 0 for x & y, the increment never happens so as you scroll down the page telerik fails to factor in your scroll and you loading panel shows further and further above the element it should cover.
I'm not posting the telerik code because I wasn't for sure if it is allowed to add the telerik source that seems to be the problem. Our current source is currently too much to post as an example but I'll try to come up with smaller test case to illustrate the bug.
In the meantime, I've found the removing the check for whether x&y of the form is less than zero and simply incrementing the value no matter what seems to solve the issue in my particular case. Of course, I'd rather not have to override a core method of the telerik source if there is another work around.