From: godchap <svn...@pl...> - 2007-06-30 21:41:34
|
Author: godchap Date: Sat Jun 30 21:41:37 2007 New Revision: 15641 Modified: CMFPlone/trunk/skins/plone_ecmascript/toc.js Log: clean toc first before adding nodes; work for ajax as well now Modified: CMFPlone/trunk/skins/plone_ecmascript/toc.js ============================================================================== --- CMFPlone/trunk/skins/plone_ecmascript/toc.js (original) +++ CMFPlone/trunk/skins/plone_ecmascript/toc.js Sat Jun 30 21:41:37 2007 @@ -49,6 +49,11 @@ return; } dest = dest[0]; + if ( dest.hasChildNodes() ) { + while ( dest.childNodes.length >= 1 ) { + dest.removeChild( dest.firstChild ); + } + } var content = getContentArea(); if (!content) { @@ -97,4 +102,4 @@ } } -registerPloneFunction(createTableOfContents); \ No newline at end of file +registerPloneFunction(createTableOfContents); |