diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 883eb5a..dfad646 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -4,6 +4,9 @@ Changelog 1.0.7 (unreleased) ------------------ +* Added check in tree generation if it allready exists (reopening the contenttree window). + [phgross] + 1.0.6 (2012-09-28) ------------------ diff --git a/plone/formwidget/contenttree/jquery-contenttree/contenttree.js b/plone/formwidget/contenttree/jquery-contenttree/contenttree.js index 0ae732d..891187b 100755 --- a/plone/formwidget/contenttree/jquery-contenttree/contenttree.js +++ b/plone/formwidget/contenttree/jquery-contenttree/contenttree.js @@ -105,10 +105,12 @@ if(jQuery) (function($){ $(t).find('li.selectable a').bind(o.selectEvent, handleSelectEvent); } - $(this).each(function() { + if ($(this).children('ul.navTree').length <= 0) { + $(this).each(function() { + loadTree(this, o.rootUrl, 0); + }); + } - loadTree(this, o.rootUrl, 0); - }); } });