summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2011-07-04 22:55:11 +0200
committerAndreas Gohr <andi@splitbrain.org>2011-07-04 22:55:11 +0200
commit0589eb71f959c92226f31a408aefc1ca4306b54d (patch)
tree6e0720351084a4567893a44c85446bc7cf41fc6e
parent98becf95e016e35cc6b03fd7863bddfe5c31d979 (diff)
downloadrpg-0589eb71f959c92226f31a408aefc1ca4306b54d.tar.gz
rpg-0589eb71f959c92226f31a408aefc1ca4306b54d.tar.bz2
deprecated findPosX and findPosY
-rw-r--r--lib/scripts/compatibility.js11
-rw-r--r--lib/scripts/script.js39
2 files changed, 11 insertions, 39 deletions
diff --git a/lib/scripts/compatibility.js b/lib/scripts/compatibility.js
index 54eb07632..bd5403f0d 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 8adba829c..68687c14e 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/