From c77534c9f5fe4b0777f9b88830ce894dc6feff37 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 27 Mar 2009 19:58:50 +0000 Subject: [PATCH] added an appendclear function to remove child nodes befor inserting a new one git-svn-id: svn://svn.open-ils.org/ILS/trunk@12705 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/Util.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Open-ILS/web/js/dojo/openils/Util.js b/Open-ILS/web/js/dojo/openils/Util.js index 959b22eaf..5439bbca7 100644 --- a/Open-ILS/web/js/dojo/openils/Util.js +++ b/Open-ILS/web/js/dojo/openils/Util.js @@ -242,6 +242,13 @@ if(!dojo._hasResource["openils.Util"]) { openils.Util.hide(node); }; + openils.Util.appendClear = function(node, child) { + if(typeof node == 'string') + node = dojo.byId(node); + while(node.childNodes[0]) + node.removeChild(node.childNodes[0]); + node.appendChild(child); + }; } -- 2.11.0