From fa49b277e3cbaa5db63502ea520283cf8f44a00e Mon Sep 17 00:00:00 2001 From: "philippe.gross" Date: Mon, 12 Nov 2012 09:46:46 +0100 Subject: [PATCH] Added check in tree generation if it allready exists (reopening the contenttree window). --- docs/HISTORY.txt | 3 +++ .../contenttree/jquery-contenttree/contenttree.js | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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); - }); } });