diff --git a/lib/scripts/compatibility.js b/lib/scripts/compatibility.js index 54eb07632fb44222b85348622ba82709bbbc634e..bd5403f0dc49b26073da57dcc730ee240700605d 100644 --- a/lib/scripts/compatibility.js +++ b/lib/scripts/compatibility.js @@ -12,3 +12,14 @@ var ajax_quicksearch = { clear_results: DEPRECATED_WRAP(dw_qsearch.clear_results, dw_qsearch), onCompletion: DEPRECATED_WRAP(dw_qsearch.onCompletion, dw_qsearch) }; + +function findPosX(object){ + DEPRECATED('Use jQuery.position() instead'); + return jQuery(object).position().left; +} + +function findPosY(object){ + DEPRECATED('Use jQuery.position() instead'); + return jQuery(object).position().top; +} + diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 8adba829ca41423f5c82da4e3af82725d91c91cf..68687c14e601935de645594809b79f941e122a57 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -123,45 +123,6 @@ function getElementsByClass(searchClass,node,tag) { return classElements; } -/** - * Get the X offset of the top left corner of the given object - * - * @link http://www.quirksmode.org/js/findpos.html - */ -function findPosX(object){ - var curleft = 0; - var obj = $(object); - if (obj.offsetParent){ - do { - curleft += obj.offsetLeft; - } while (obj = obj.offsetParent); - } - else if (obj.x){ - curleft += obj.x; - } - return curleft; -} //end findPosX function - -/** - * Get the Y offset of the top left corner of the given object - * - * @link http://www.quirksmode.org/js/findpos.html - */ -function findPosY(object){ - var curtop = 0; - var obj = $(object); - if (obj.offsetParent){ - do { - curtop += obj.offsetTop; - } while (obj = obj.offsetParent); - } - else if (obj.y){ - curtop += obj.y; - } - return curtop; -} //end findPosY function - -/** * Get the computed style of a node. * * @link https://acidmartin.wordpress.com/2008/08/26/style-get-any-css-property-value-of-an-object/