diff options
author | Andreas Gohr <andi@splitbrain.org> | 2011-07-08 13:12:06 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2011-07-08 13:12:06 +0200 |
commit | ff9f537503912e41605048e604fb938256468001 (patch) | |
tree | 0474ec76b8a8720b90a85945a23c1a26ae832bd9 /lib/scripts | |
parent | 32cb905a0339607a7acfef6488bec0015bae6b8b (diff) | |
download | rpg-ff9f537503912e41605048e604fb938256468001.tar.gz rpg-ff9f537503912e41605048e604fb938256468001.tar.bz2 |
deprecated prependChild()
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/compatibility.js | 6 | ||||
-rw-r--r-- | lib/scripts/script.js | 13 |
2 files changed, 6 insertions, 13 deletions
diff --git a/lib/scripts/compatibility.js b/lib/scripts/compatibility.js index 1ab7d02ad..e9d845625 100644 --- a/lib/scripts/compatibility.js +++ b/lib/scripts/compatibility.js @@ -49,3 +49,9 @@ function getElementsByClass(searchClass,node,tag){ if(node == null) node = document; return jQuery(node).find(tag+'.'+searchClass).toArray(); } + +function prependChild(parent,element) { + DEPRECATED('Use jQuery.prepend() instead'); + jQuery(parent).prepend(element); +} + diff --git a/lib/scripts/script.js b/lib/scripts/script.js index e3216177c..b44d95d6f 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -147,19 +147,6 @@ function escapeQuotes(text) { } /** - * Adds a node as the first childenode to the given parent - * - * @see appendChild() - */ -function prependChild(parent,element) { - if(!parent.firstChild){ - parent.appendChild(element); - }else{ - parent.insertBefore(element,parent.firstChild); - } -} - -/** * Prints a animated gif to show the search is performed * * Because we need to modify the DOM here before the document is loaded |